@scaleway/sdk 1.34.0 → 2.0.0-alpha.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 +1 -1
- package/dist/api/account/v3/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +26 -26
- package/dist/api/baremetal/v1/api.gen.js +6 -6
- package/dist/api/baremetal/v1/marshalling.gen.js +109 -120
- package/dist/api/billing/v2alpha1/api.gen.js +3 -3
- package/dist/api/billing/v2alpha1/marshalling.gen.js +9 -9
- package/dist/api/cockpit/v1beta1/api.gen.js +47 -71
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +43 -63
- package/dist/api/container/v1beta1/api.gen.js +11 -11
- package/dist/api/container/v1beta1/marshalling.gen.js +76 -102
- package/dist/api/document_db/v1beta1/api.gen.js +6 -6
- package/dist/api/document_db/v1beta1/marshalling.gen.js +169 -225
- package/dist/api/domain/v2beta1/api.gen.js +45 -38
- package/dist/api/domain/v2beta1/index.gen.js +2 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +361 -575
- package/dist/api/flexibleip/v1alpha1/api.gen.js +15 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +11 -11
- package/dist/api/function/v1beta1/marshalling.gen.js +103 -129
- package/dist/api/iam/v1alpha1/api.gen.js +64 -32
- package/dist/api/iam/v1alpha1/marshalling.gen.js +68 -78
- package/dist/api/instance/v1/api.gen.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +397 -602
- package/dist/api/iot/v1/api.gen.js +35 -27
- package/dist/api/iot/v1/marshalling.gen.js +111 -162
- package/dist/api/ipfs/v1alpha1/api.gen.js +2 -2
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +23 -27
- package/dist/api/k8s/v1/api.gen.js +3 -3
- package/dist/api/k8s/v1/marshalling.gen.js +109 -194
- package/dist/api/lb/v1/api.gen.js +583 -552
- package/dist/api/lb/v1/marshalling.gen.js +245 -361
- package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
- package/dist/api/marketplace/v2/api.gen.js +6 -6
- package/dist/api/mnq/v1alpha1/api.gen.js +21 -14
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +35 -40
- package/dist/api/rdb/v1/api.gen.js +7 -7
- package/dist/api/rdb/v1/marshalling.gen.js +184 -240
- package/dist/api/redis/v1/api.gen.js +1 -1
- package/dist/api/redis/v1/marshalling.gen.js +73 -97
- package/dist/api/registry/v1/api.gen.js +3 -3
- package/dist/api/registry/v1/marshalling.gen.js +5 -7
- package/dist/api/secret/v1alpha1/api.gen.js +2 -2
- package/dist/api/secret/v1alpha1/marshalling.gen.js +20 -30
- package/dist/api/tem/v1alpha1/api.gen.js +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +52 -61
- package/dist/api/test/v1/api.gen.js +8 -25
- package/dist/api/test/v1/marshalling.gen.js +5 -7
- package/dist/api/vpc/v1/api.gen.js +1 -1
- package/dist/api/vpc/v2/api.gen.js +2 -2
- package/dist/api/vpc/v2/marshalling.gen.js +3 -5
- package/dist/api/vpcgw/v1/api.gen.js +6 -6
- package/dist/api/vpcgw/v1/marshalling.gen.js +36 -49
- package/dist/api/webhosting/v1alpha1/api.gen.js +56 -4
- package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +69 -42
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -1
- package/dist/index.cjs +3127 -3989
- package/dist/index.d.ts +9658 -12221
- package/package.json +2 -2
|
@@ -4,50 +4,37 @@ import { unmarshalDate, unmarshalMapOfObject, unmarshalArrayOfObject, resolveOne
|
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
6
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const
|
|
7
|
+
const unmarshalPrivateNIC = data => {
|
|
8
8
|
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type '
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`);
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
12
|
id: data.id,
|
|
13
|
-
|
|
13
|
+
macAddress: data.mac_address,
|
|
14
|
+
privateNetworkId: data.private_network_id,
|
|
15
|
+
serverId: data.server_id,
|
|
16
|
+
state: data.state,
|
|
17
|
+
tags: data.tags
|
|
14
18
|
};
|
|
15
19
|
};
|
|
16
|
-
const
|
|
20
|
+
const unmarshalVolumeSummary = data => {
|
|
17
21
|
if (!isJSONObject(data)) {
|
|
18
|
-
throw new TypeError(`Unmarshalling the type '
|
|
22
|
+
throw new TypeError(`Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`);
|
|
19
23
|
}
|
|
20
24
|
return {
|
|
21
|
-
arch: data.arch,
|
|
22
|
-
bootcmdargs: data.bootcmdargs,
|
|
23
|
-
default: data.default,
|
|
24
|
-
dtb: data.dtb,
|
|
25
25
|
id: data.id,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
project: data.project,
|
|
30
|
-
public: data.public,
|
|
31
|
-
title: data.title,
|
|
32
|
-
zone: data.zone
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const unmarshalServerTypeNetworkInterface = data => {
|
|
36
|
-
if (!isJSONObject(data)) {
|
|
37
|
-
throw new TypeError(`Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`);
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
internalBandwidth: data.internal_bandwidth,
|
|
41
|
-
internetBandwidth: data.internet_bandwidth
|
|
26
|
+
name: data.name,
|
|
27
|
+
size: data.size,
|
|
28
|
+
volumeType: data.volume_type
|
|
42
29
|
};
|
|
43
30
|
};
|
|
44
|
-
const
|
|
31
|
+
const unmarshalServerSummary = data => {
|
|
45
32
|
if (!isJSONObject(data)) {
|
|
46
|
-
throw new TypeError(`Unmarshalling the type '
|
|
33
|
+
throw new TypeError(`Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`);
|
|
47
34
|
}
|
|
48
35
|
return {
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
id: data.id,
|
|
37
|
+
name: data.name
|
|
51
38
|
};
|
|
52
39
|
};
|
|
53
40
|
const unmarshalVolume = data => {
|
|
@@ -56,13 +43,13 @@ const unmarshalVolume = data => {
|
|
|
56
43
|
}
|
|
57
44
|
return {
|
|
58
45
|
creationDate: unmarshalDate(data.creation_date),
|
|
59
|
-
exportUri: data.export_uri,
|
|
46
|
+
exportUri: data.export_uri ? data.export_uri : undefined,
|
|
60
47
|
id: data.id,
|
|
61
48
|
modificationDate: unmarshalDate(data.modification_date),
|
|
62
49
|
name: data.name,
|
|
63
50
|
organization: data.organization,
|
|
64
51
|
project: data.project,
|
|
65
|
-
server:
|
|
52
|
+
server: unmarshalServerSummary(data.server),
|
|
66
53
|
size: data.size,
|
|
67
54
|
state: data.state,
|
|
68
55
|
tags: data.tags,
|
|
@@ -70,15 +57,23 @@ const unmarshalVolume = data => {
|
|
|
70
57
|
zone: data.zone
|
|
71
58
|
};
|
|
72
59
|
};
|
|
73
|
-
const
|
|
60
|
+
const unmarshalBootscript = data => {
|
|
74
61
|
if (!isJSONObject(data)) {
|
|
75
|
-
throw new TypeError(`Unmarshalling the type '
|
|
62
|
+
throw new TypeError(`Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`);
|
|
76
63
|
}
|
|
77
64
|
return {
|
|
65
|
+
arch: data.arch,
|
|
66
|
+
bootcmdargs: data.bootcmdargs,
|
|
67
|
+
default: data.default,
|
|
68
|
+
dtb: data.dtb,
|
|
78
69
|
id: data.id,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
initrd: data.initrd,
|
|
71
|
+
kernel: data.kernel,
|
|
72
|
+
organization: data.organization,
|
|
73
|
+
project: data.project,
|
|
74
|
+
public: data.public,
|
|
75
|
+
title: data.title,
|
|
76
|
+
zone: data.zone
|
|
82
77
|
};
|
|
83
78
|
};
|
|
84
79
|
const unmarshalImage = data => {
|
|
@@ -97,125 +92,146 @@ const unmarshalImage = data => {
|
|
|
97
92
|
organization: data.organization,
|
|
98
93
|
project: data.project,
|
|
99
94
|
public: data.public,
|
|
100
|
-
rootVolume:
|
|
95
|
+
rootVolume: unmarshalVolumeSummary(data.root_volume),
|
|
101
96
|
state: data.state,
|
|
102
97
|
tags: data.tags,
|
|
103
98
|
zone: data.zone
|
|
104
99
|
};
|
|
105
100
|
};
|
|
106
|
-
const
|
|
101
|
+
const unmarshalCreateImageResponse = data => {
|
|
107
102
|
if (!isJSONObject(data)) {
|
|
108
|
-
throw new TypeError(`Unmarshalling the type '
|
|
103
|
+
throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);
|
|
109
104
|
}
|
|
110
105
|
return {
|
|
106
|
+
image: unmarshalImage(data.image)
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const unmarshalIp = data => {
|
|
110
|
+
if (!isJSONObject(data)) {
|
|
111
|
+
throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
address: data.address,
|
|
111
115
|
id: data.id,
|
|
112
|
-
name: data.name,
|
|
113
116
|
organization: data.organization,
|
|
114
|
-
|
|
115
|
-
policyRespected: data.policy_respected,
|
|
116
|
-
policyType: data.policy_type,
|
|
117
|
+
prefix: data.prefix,
|
|
117
118
|
project: data.project,
|
|
119
|
+
reverse: data.reverse ? data.reverse : undefined,
|
|
120
|
+
server: unmarshalServerSummary(data.server),
|
|
121
|
+
state: data.state,
|
|
118
122
|
tags: data.tags,
|
|
123
|
+
type: data.type,
|
|
119
124
|
zone: data.zone
|
|
120
125
|
};
|
|
121
126
|
};
|
|
122
|
-
const
|
|
127
|
+
const unmarshalCreateIpResponse = data => {
|
|
123
128
|
if (!isJSONObject(data)) {
|
|
124
|
-
throw new TypeError(`Unmarshalling the type '
|
|
129
|
+
throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);
|
|
125
130
|
}
|
|
126
131
|
return {
|
|
127
|
-
|
|
128
|
-
macAddress: data.mac_address,
|
|
129
|
-
privateNetworkId: data.private_network_id,
|
|
130
|
-
serverId: data.server_id,
|
|
131
|
-
state: data.state,
|
|
132
|
-
tags: data.tags
|
|
132
|
+
ip: unmarshalIp(data.ip)
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
-
const
|
|
135
|
+
const unmarshalPlacementGroup = data => {
|
|
136
136
|
if (!isJSONObject(data)) {
|
|
137
|
-
throw new TypeError(`Unmarshalling the type '
|
|
137
|
+
throw new TypeError(`Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`);
|
|
138
138
|
}
|
|
139
139
|
return {
|
|
140
140
|
id: data.id,
|
|
141
|
-
name: data.name
|
|
141
|
+
name: data.name,
|
|
142
|
+
organization: data.organization,
|
|
143
|
+
policyMode: data.policy_mode,
|
|
144
|
+
policyRespected: data.policy_respected,
|
|
145
|
+
policyType: data.policy_type,
|
|
146
|
+
project: data.project,
|
|
147
|
+
tags: data.tags,
|
|
148
|
+
zone: data.zone
|
|
142
149
|
};
|
|
143
150
|
};
|
|
144
|
-
const
|
|
151
|
+
const unmarshalCreatePlacementGroupResponse = data => {
|
|
145
152
|
if (!isJSONObject(data)) {
|
|
146
|
-
throw new TypeError(`Unmarshalling the type '
|
|
153
|
+
throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);
|
|
147
154
|
}
|
|
148
155
|
return {
|
|
149
|
-
|
|
150
|
-
dynamic: data.dynamic,
|
|
151
|
-
family: data.family,
|
|
152
|
-
gateway: data.gateway,
|
|
153
|
-
id: data.id,
|
|
154
|
-
netmask: data.netmask,
|
|
155
|
-
provisioningMode: data.provisioning_mode
|
|
156
|
+
placementGroup: unmarshalPlacementGroup(data.placement_group)
|
|
156
157
|
};
|
|
157
158
|
};
|
|
158
|
-
const
|
|
159
|
+
const unmarshalCreatePrivateNICResponse = data => {
|
|
159
160
|
if (!isJSONObject(data)) {
|
|
160
|
-
throw new TypeError(`Unmarshalling the type '
|
|
161
|
+
throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);
|
|
161
162
|
}
|
|
162
163
|
return {
|
|
163
|
-
|
|
164
|
-
gateway: data.gateway,
|
|
165
|
-
netmask: data.netmask
|
|
164
|
+
privateNic: unmarshalPrivateNIC(data.private_nic)
|
|
166
165
|
};
|
|
167
166
|
};
|
|
168
|
-
const
|
|
167
|
+
const unmarshalSecurityGroup = data => {
|
|
169
168
|
if (!isJSONObject(data)) {
|
|
170
|
-
throw new TypeError(`Unmarshalling the type '
|
|
169
|
+
throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`);
|
|
171
170
|
}
|
|
172
171
|
return {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
creationDate: unmarshalDate(data.creation_date),
|
|
173
|
+
description: data.description,
|
|
174
|
+
enableDefaultSecurity: data.enable_default_security,
|
|
175
|
+
id: data.id,
|
|
176
|
+
inboundDefaultPolicy: data.inbound_default_policy,
|
|
177
|
+
modificationDate: unmarshalDate(data.modification_date),
|
|
178
|
+
name: data.name,
|
|
179
|
+
organization: data.organization,
|
|
180
|
+
organizationDefault: data.organization_default ? data.organization_default : undefined,
|
|
181
|
+
outboundDefaultPolicy: data.outbound_default_policy,
|
|
182
|
+
project: data.project,
|
|
183
|
+
projectDefault: data.project_default,
|
|
184
|
+
servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
|
|
185
|
+
state: data.state,
|
|
186
|
+
stateful: data.stateful,
|
|
187
|
+
tags: data.tags,
|
|
188
|
+
zone: data.zone
|
|
178
189
|
};
|
|
179
190
|
};
|
|
180
|
-
const
|
|
191
|
+
const unmarshalCreateSecurityGroupResponse = data => {
|
|
181
192
|
if (!isJSONObject(data)) {
|
|
182
|
-
throw new TypeError(`Unmarshalling the type '
|
|
193
|
+
throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);
|
|
183
194
|
}
|
|
184
195
|
return {
|
|
185
|
-
|
|
196
|
+
securityGroup: unmarshalSecurityGroup(data.security_group)
|
|
186
197
|
};
|
|
187
198
|
};
|
|
188
|
-
const
|
|
199
|
+
const unmarshalSecurityGroupRule = data => {
|
|
189
200
|
if (!isJSONObject(data)) {
|
|
190
|
-
throw new TypeError(`Unmarshalling the type '
|
|
201
|
+
throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`);
|
|
191
202
|
}
|
|
192
203
|
return {
|
|
193
|
-
|
|
194
|
-
|
|
204
|
+
action: data.action,
|
|
205
|
+
destPortFrom: data.dest_port_from ? data.dest_port_from : undefined,
|
|
206
|
+
destPortTo: data.dest_port_to ? data.dest_port_to : undefined,
|
|
207
|
+
direction: data.direction,
|
|
208
|
+
editable: data.editable,
|
|
209
|
+
id: data.id,
|
|
210
|
+
ipRange: data.ip_range,
|
|
211
|
+
position: data.position,
|
|
212
|
+
protocol: data.protocol,
|
|
213
|
+
zone: data.zone
|
|
195
214
|
};
|
|
196
215
|
};
|
|
197
|
-
const
|
|
216
|
+
const unmarshalCreateSecurityGroupRuleResponse = data => {
|
|
198
217
|
if (!isJSONObject(data)) {
|
|
199
|
-
throw new TypeError(`Unmarshalling the type '
|
|
218
|
+
throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
|
|
200
219
|
}
|
|
201
220
|
return {
|
|
202
|
-
|
|
203
|
-
ipv6Support: data.ipv6_support,
|
|
204
|
-
sumInternalBandwidth: data.sum_internal_bandwidth,
|
|
205
|
-
sumInternetBandwidth: data.sum_internet_bandwidth
|
|
221
|
+
rule: unmarshalSecurityGroupRule(data.rule)
|
|
206
222
|
};
|
|
207
223
|
};
|
|
208
|
-
const
|
|
224
|
+
const unmarshalServerMaintenance = data => {
|
|
209
225
|
if (!isJSONObject(data)) {
|
|
210
|
-
throw new TypeError(`Unmarshalling the type '
|
|
226
|
+
throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);
|
|
211
227
|
}
|
|
212
228
|
return {
|
|
213
|
-
|
|
229
|
+
reason: data.reason
|
|
214
230
|
};
|
|
215
231
|
};
|
|
216
|
-
const
|
|
232
|
+
const unmarshalSecurityGroupSummary = data => {
|
|
217
233
|
if (!isJSONObject(data)) {
|
|
218
|
-
throw new TypeError(`Unmarshalling the type '
|
|
234
|
+
throw new TypeError(`Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`);
|
|
219
235
|
}
|
|
220
236
|
return {
|
|
221
237
|
id: data.id,
|
|
@@ -235,127 +251,47 @@ const unmarshalVolumeServer = data => {
|
|
|
235
251
|
name: data.name,
|
|
236
252
|
organization: data.organization,
|
|
237
253
|
project: data.project,
|
|
238
|
-
server:
|
|
254
|
+
server: unmarshalServerSummary(data.server),
|
|
239
255
|
size: data.size,
|
|
240
256
|
state: data.state,
|
|
241
257
|
volumeType: data.volume_type,
|
|
242
258
|
zone: data.zone
|
|
243
259
|
};
|
|
244
260
|
};
|
|
245
|
-
const
|
|
246
|
-
if (!isJSONObject(data)) {
|
|
247
|
-
throw new TypeError(`Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`);
|
|
248
|
-
}
|
|
249
|
-
return {
|
|
250
|
-
snapshot: data.snapshot
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
const unmarshalVolumeTypeConstraints = data => {
|
|
254
|
-
if (!isJSONObject(data)) {
|
|
255
|
-
throw new TypeError(`Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`);
|
|
256
|
-
}
|
|
257
|
-
return {
|
|
258
|
-
max: data.max,
|
|
259
|
-
min: data.min
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
const unmarshalDashboard = data => {
|
|
263
|
-
if (!isJSONObject(data)) {
|
|
264
|
-
throw new TypeError(`Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`);
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
imagesCount: data.images_count,
|
|
268
|
-
ipsCount: data.ips_count,
|
|
269
|
-
ipsUnused: data.ips_unused,
|
|
270
|
-
placementGroupsCount: data.placement_groups_count,
|
|
271
|
-
privateNicsCount: data.private_nics_count,
|
|
272
|
-
runningServersCount: data.running_servers_count,
|
|
273
|
-
securityGroupsCount: data.security_groups_count,
|
|
274
|
-
serversByTypes: data.servers_by_types,
|
|
275
|
-
serversCount: data.servers_count,
|
|
276
|
-
snapshotsCount: data.snapshots_count,
|
|
277
|
-
volumesBSsdCount: data.volumes_b_ssd_count,
|
|
278
|
-
volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
|
|
279
|
-
volumesCount: data.volumes_count,
|
|
280
|
-
volumesLSsdCount: data.volumes_l_ssd_count,
|
|
281
|
-
volumesLSsdTotalSize: data.volumes_l_ssd_total_size
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
const unmarshalGetServerTypesAvailabilityResponseAvailability = data => {
|
|
285
|
-
if (!isJSONObject(data)) {
|
|
286
|
-
throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`);
|
|
287
|
-
}
|
|
288
|
-
return {
|
|
289
|
-
availability: data.availability
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
const unmarshalIp = data => {
|
|
261
|
+
const unmarshalServerIpv6 = data => {
|
|
293
262
|
if (!isJSONObject(data)) {
|
|
294
|
-
throw new TypeError(`Unmarshalling the type '
|
|
263
|
+
throw new TypeError(`Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`);
|
|
295
264
|
}
|
|
296
265
|
return {
|
|
297
266
|
address: data.address,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
prefix: data.prefix,
|
|
301
|
-
project: data.project,
|
|
302
|
-
reverse: data.reverse,
|
|
303
|
-
server: data.server ? unmarshalServerSummary(data.server) : undefined,
|
|
304
|
-
state: data.state,
|
|
305
|
-
tags: data.tags,
|
|
306
|
-
type: data.type,
|
|
307
|
-
zone: data.zone
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
const unmarshalPlacementGroupServer = data => {
|
|
311
|
-
if (!isJSONObject(data)) {
|
|
312
|
-
throw new TypeError(`Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`);
|
|
313
|
-
}
|
|
314
|
-
return {
|
|
315
|
-
id: data.id,
|
|
316
|
-
name: data.name,
|
|
317
|
-
policyRespected: data.policy_respected
|
|
267
|
+
gateway: data.gateway,
|
|
268
|
+
netmask: data.netmask
|
|
318
269
|
};
|
|
319
270
|
};
|
|
320
|
-
const
|
|
271
|
+
const unmarshalServerLocation = data => {
|
|
321
272
|
if (!isJSONObject(data)) {
|
|
322
|
-
throw new TypeError(`Unmarshalling the type '
|
|
273
|
+
throw new TypeError(`Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`);
|
|
323
274
|
}
|
|
324
275
|
return {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
modificationDate: unmarshalDate(data.modification_date),
|
|
331
|
-
name: data.name,
|
|
332
|
-
organization: data.organization,
|
|
333
|
-
organizationDefault: data.organization_default,
|
|
334
|
-
outboundDefaultPolicy: data.outbound_default_policy,
|
|
335
|
-
project: data.project,
|
|
336
|
-
projectDefault: data.project_default,
|
|
337
|
-
servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
|
|
338
|
-
state: data.state,
|
|
339
|
-
stateful: data.stateful,
|
|
340
|
-
tags: data.tags,
|
|
341
|
-
zone: data.zone
|
|
276
|
+
clusterId: data.cluster_id,
|
|
277
|
+
hypervisorId: data.hypervisor_id,
|
|
278
|
+
nodeId: data.node_id,
|
|
279
|
+
platformId: data.platform_id,
|
|
280
|
+
zoneId: data.zone_id
|
|
342
281
|
};
|
|
343
282
|
};
|
|
344
|
-
const
|
|
283
|
+
const unmarshalServerIp = data => {
|
|
345
284
|
if (!isJSONObject(data)) {
|
|
346
|
-
throw new TypeError(`Unmarshalling the type '
|
|
285
|
+
throw new TypeError(`Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`);
|
|
347
286
|
}
|
|
348
287
|
return {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
editable: data.editable,
|
|
288
|
+
address: data.address,
|
|
289
|
+
dynamic: data.dynamic,
|
|
290
|
+
family: data.family,
|
|
291
|
+
gateway: data.gateway,
|
|
354
292
|
id: data.id,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
protocol: data.protocol,
|
|
358
|
-
zone: data.zone
|
|
293
|
+
netmask: data.netmask,
|
|
294
|
+
provisioningMode: data.provisioning_mode
|
|
359
295
|
};
|
|
360
296
|
};
|
|
361
297
|
const unmarshalServer = data => {
|
|
@@ -365,31 +301,31 @@ const unmarshalServer = data => {
|
|
|
365
301
|
return {
|
|
366
302
|
allowedActions: data.allowed_actions,
|
|
367
303
|
arch: data.arch,
|
|
368
|
-
bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined,
|
|
369
304
|
bootType: data.boot_type,
|
|
305
|
+
bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined,
|
|
370
306
|
commercialType: data.commercial_type,
|
|
371
307
|
creationDate: unmarshalDate(data.creation_date),
|
|
372
308
|
dynamicIpRequired: data.dynamic_ip_required,
|
|
373
309
|
enableIpv6: data.enable_ipv6,
|
|
374
310
|
hostname: data.hostname,
|
|
375
311
|
id: data.id,
|
|
376
|
-
image:
|
|
377
|
-
ipv6:
|
|
378
|
-
location:
|
|
312
|
+
image: unmarshalImage(data.image),
|
|
313
|
+
ipv6: unmarshalServerIpv6(data.ipv6),
|
|
314
|
+
location: unmarshalServerLocation(data.location),
|
|
379
315
|
macAddress: data.mac_address,
|
|
380
316
|
maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance),
|
|
381
317
|
modificationDate: unmarshalDate(data.modification_date),
|
|
382
318
|
name: data.name,
|
|
383
319
|
organization: data.organization,
|
|
384
|
-
placementGroup:
|
|
385
|
-
privateIp: data.private_ip,
|
|
320
|
+
placementGroup: unmarshalPlacementGroup(data.placement_group),
|
|
321
|
+
privateIp: data.private_ip ? data.private_ip : undefined,
|
|
386
322
|
privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),
|
|
387
323
|
project: data.project,
|
|
388
324
|
protected: data.protected,
|
|
389
|
-
publicIp:
|
|
325
|
+
publicIp: unmarshalServerIp(data.public_ip),
|
|
390
326
|
publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),
|
|
391
327
|
routedIpEnabled: data.routed_ip_enabled,
|
|
392
|
-
securityGroup:
|
|
328
|
+
securityGroup: unmarshalSecurityGroupSummary(data.security_group),
|
|
393
329
|
state: data.state,
|
|
394
330
|
stateDetail: data.state_detail,
|
|
395
331
|
tags: data.tags,
|
|
@@ -397,44 +333,12 @@ const unmarshalServer = data => {
|
|
|
397
333
|
zone: data.zone
|
|
398
334
|
};
|
|
399
335
|
};
|
|
400
|
-
const
|
|
401
|
-
if (!isJSONObject(data)) {
|
|
402
|
-
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
403
|
-
}
|
|
404
|
-
return {
|
|
405
|
-
altNames: data.alt_names,
|
|
406
|
-
arch: data.arch,
|
|
407
|
-
baremetal: data.baremetal,
|
|
408
|
-
capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined,
|
|
409
|
-
gpu: data.gpu,
|
|
410
|
-
hourlyPrice: data.hourly_price,
|
|
411
|
-
monthlyPrice: data.monthly_price,
|
|
412
|
-
ncpus: data.ncpus,
|
|
413
|
-
network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined,
|
|
414
|
-
perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : undefined,
|
|
415
|
-
ram: data.ram,
|
|
416
|
-
scratchStorageMaxSize: data.scratch_storage_max_size,
|
|
417
|
-
volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : undefined
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
const unmarshalSnapshot = data => {
|
|
336
|
+
const unmarshalCreateServerResponse = data => {
|
|
421
337
|
if (!isJSONObject(data)) {
|
|
422
|
-
throw new TypeError(`Unmarshalling the type '
|
|
338
|
+
throw new TypeError(`Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`);
|
|
423
339
|
}
|
|
424
340
|
return {
|
|
425
|
-
|
|
426
|
-
creationDate: unmarshalDate(data.creation_date),
|
|
427
|
-
errorReason: data.error_reason,
|
|
428
|
-
id: data.id,
|
|
429
|
-
modificationDate: unmarshalDate(data.modification_date),
|
|
430
|
-
name: data.name,
|
|
431
|
-
organization: data.organization,
|
|
432
|
-
project: data.project,
|
|
433
|
-
size: data.size,
|
|
434
|
-
state: data.state,
|
|
435
|
-
tags: data.tags,
|
|
436
|
-
volumeType: data.volume_type,
|
|
437
|
-
zone: data.zone
|
|
341
|
+
server: unmarshalServer(data.server)
|
|
438
342
|
};
|
|
439
343
|
};
|
|
440
344
|
const unmarshalTask = data => {
|
|
@@ -453,70 +357,33 @@ const unmarshalTask = data => {
|
|
|
453
357
|
zone: data.zone
|
|
454
358
|
};
|
|
455
359
|
};
|
|
456
|
-
const
|
|
457
|
-
if (!isJSONObject(data)) {
|
|
458
|
-
throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
|
|
459
|
-
}
|
|
460
|
-
return {
|
|
461
|
-
capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : undefined,
|
|
462
|
-
constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : undefined,
|
|
463
|
-
displayName: data.display_name
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
const unmarshalCreateImageResponse = data => {
|
|
467
|
-
if (!isJSONObject(data)) {
|
|
468
|
-
throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);
|
|
469
|
-
}
|
|
470
|
-
return {
|
|
471
|
-
image: data.image ? unmarshalImage(data.image) : undefined
|
|
472
|
-
};
|
|
473
|
-
};
|
|
474
|
-
const unmarshalCreateIpResponse = data => {
|
|
475
|
-
if (!isJSONObject(data)) {
|
|
476
|
-
throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);
|
|
477
|
-
}
|
|
478
|
-
return {
|
|
479
|
-
ip: data.ip ? unmarshalIp(data.ip) : undefined
|
|
480
|
-
};
|
|
481
|
-
};
|
|
482
|
-
const unmarshalCreatePlacementGroupResponse = data => {
|
|
483
|
-
if (!isJSONObject(data)) {
|
|
484
|
-
throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);
|
|
485
|
-
}
|
|
486
|
-
return {
|
|
487
|
-
placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
const unmarshalCreatePrivateNICResponse = data => {
|
|
491
|
-
if (!isJSONObject(data)) {
|
|
492
|
-
throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);
|
|
493
|
-
}
|
|
494
|
-
return {
|
|
495
|
-
privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined
|
|
496
|
-
};
|
|
497
|
-
};
|
|
498
|
-
const unmarshalCreateSecurityGroupResponse = data => {
|
|
499
|
-
if (!isJSONObject(data)) {
|
|
500
|
-
throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);
|
|
501
|
-
}
|
|
502
|
-
return {
|
|
503
|
-
securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined
|
|
504
|
-
};
|
|
505
|
-
};
|
|
506
|
-
const unmarshalCreateSecurityGroupRuleResponse = data => {
|
|
360
|
+
const unmarshalSnapshotBaseVolume = data => {
|
|
507
361
|
if (!isJSONObject(data)) {
|
|
508
|
-
throw new TypeError(`Unmarshalling the type '
|
|
362
|
+
throw new TypeError(`Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`);
|
|
509
363
|
}
|
|
510
364
|
return {
|
|
511
|
-
|
|
365
|
+
id: data.id,
|
|
366
|
+
name: data.name
|
|
512
367
|
};
|
|
513
368
|
};
|
|
514
|
-
const
|
|
369
|
+
const unmarshalSnapshot = data => {
|
|
515
370
|
if (!isJSONObject(data)) {
|
|
516
|
-
throw new TypeError(`Unmarshalling the type '
|
|
371
|
+
throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
517
372
|
}
|
|
518
373
|
return {
|
|
519
|
-
|
|
374
|
+
baseVolume: unmarshalSnapshotBaseVolume(data.base_volume),
|
|
375
|
+
creationDate: unmarshalDate(data.creation_date),
|
|
376
|
+
errorReason: data.error_reason ? data.error_reason : undefined,
|
|
377
|
+
id: data.id,
|
|
378
|
+
modificationDate: unmarshalDate(data.modification_date),
|
|
379
|
+
name: data.name,
|
|
380
|
+
organization: data.organization,
|
|
381
|
+
project: data.project,
|
|
382
|
+
size: data.size,
|
|
383
|
+
state: data.state,
|
|
384
|
+
tags: data.tags,
|
|
385
|
+
volumeType: data.volume_type,
|
|
386
|
+
zone: data.zone
|
|
520
387
|
};
|
|
521
388
|
};
|
|
522
389
|
const unmarshalCreateSnapshotResponse = data => {
|
|
@@ -524,8 +391,8 @@ const unmarshalCreateSnapshotResponse = data => {
|
|
|
524
391
|
throw new TypeError(`Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`);
|
|
525
392
|
}
|
|
526
393
|
return {
|
|
527
|
-
snapshot:
|
|
528
|
-
task:
|
|
394
|
+
snapshot: unmarshalSnapshot(data.snapshot),
|
|
395
|
+
task: unmarshalTask(data.task)
|
|
529
396
|
};
|
|
530
397
|
};
|
|
531
398
|
const unmarshalCreateVolumeResponse = data => {
|
|
@@ -533,7 +400,7 @@ const unmarshalCreateVolumeResponse = data => {
|
|
|
533
400
|
throw new TypeError(`Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`);
|
|
534
401
|
}
|
|
535
402
|
return {
|
|
536
|
-
volume:
|
|
403
|
+
volume: unmarshalVolume(data.volume)
|
|
537
404
|
};
|
|
538
405
|
};
|
|
539
406
|
const unmarshalExportSnapshotResponse = data => {
|
|
@@ -541,7 +408,7 @@ const unmarshalExportSnapshotResponse = data => {
|
|
|
541
408
|
throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);
|
|
542
409
|
}
|
|
543
410
|
return {
|
|
544
|
-
task:
|
|
411
|
+
task: unmarshalTask(data.task)
|
|
545
412
|
};
|
|
546
413
|
};
|
|
547
414
|
const unmarshalGetBootscriptResponse = data => {
|
|
@@ -549,7 +416,29 @@ const unmarshalGetBootscriptResponse = data => {
|
|
|
549
416
|
throw new TypeError(`Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`);
|
|
550
417
|
}
|
|
551
418
|
return {
|
|
552
|
-
bootscript:
|
|
419
|
+
bootscript: unmarshalBootscript(data.bootscript)
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
const unmarshalDashboard = data => {
|
|
423
|
+
if (!isJSONObject(data)) {
|
|
424
|
+
throw new TypeError(`Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`);
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
imagesCount: data.images_count,
|
|
428
|
+
ipsCount: data.ips_count,
|
|
429
|
+
ipsUnused: data.ips_unused,
|
|
430
|
+
placementGroupsCount: data.placement_groups_count,
|
|
431
|
+
privateNicsCount: data.private_nics_count,
|
|
432
|
+
runningServersCount: data.running_servers_count,
|
|
433
|
+
securityGroupsCount: data.security_groups_count,
|
|
434
|
+
serversByTypes: data.servers_by_types,
|
|
435
|
+
serversCount: data.servers_count,
|
|
436
|
+
snapshotsCount: data.snapshots_count,
|
|
437
|
+
volumesBSsdCount: data.volumes_b_ssd_count,
|
|
438
|
+
volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
|
|
439
|
+
volumesCount: data.volumes_count,
|
|
440
|
+
volumesLSsdCount: data.volumes_l_ssd_count,
|
|
441
|
+
volumesLSsdTotalSize: data.volumes_l_ssd_total_size
|
|
553
442
|
};
|
|
554
443
|
};
|
|
555
444
|
const unmarshalGetDashboardResponse = data => {
|
|
@@ -557,7 +446,7 @@ const unmarshalGetDashboardResponse = data => {
|
|
|
557
446
|
throw new TypeError(`Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`);
|
|
558
447
|
}
|
|
559
448
|
return {
|
|
560
|
-
dashboard:
|
|
449
|
+
dashboard: unmarshalDashboard(data.dashboard)
|
|
561
450
|
};
|
|
562
451
|
};
|
|
563
452
|
const unmarshalGetImageResponse = data => {
|
|
@@ -565,7 +454,7 @@ const unmarshalGetImageResponse = data => {
|
|
|
565
454
|
throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`);
|
|
566
455
|
}
|
|
567
456
|
return {
|
|
568
|
-
image:
|
|
457
|
+
image: unmarshalImage(data.image)
|
|
569
458
|
};
|
|
570
459
|
};
|
|
571
460
|
const unmarshalGetIpResponse = data => {
|
|
@@ -573,7 +462,7 @@ const unmarshalGetIpResponse = data => {
|
|
|
573
462
|
throw new TypeError(`Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`);
|
|
574
463
|
}
|
|
575
464
|
return {
|
|
576
|
-
ip:
|
|
465
|
+
ip: unmarshalIp(data.ip)
|
|
577
466
|
};
|
|
578
467
|
};
|
|
579
468
|
const unmarshalGetPlacementGroupResponse = data => {
|
|
@@ -581,7 +470,17 @@ const unmarshalGetPlacementGroupResponse = data => {
|
|
|
581
470
|
throw new TypeError(`Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`);
|
|
582
471
|
}
|
|
583
472
|
return {
|
|
584
|
-
placementGroup:
|
|
473
|
+
placementGroup: unmarshalPlacementGroup(data.placement_group)
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
const unmarshalPlacementGroupServer = data => {
|
|
477
|
+
if (!isJSONObject(data)) {
|
|
478
|
+
throw new TypeError(`Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`);
|
|
479
|
+
}
|
|
480
|
+
return {
|
|
481
|
+
id: data.id,
|
|
482
|
+
name: data.name,
|
|
483
|
+
policyRespected: data.policy_respected
|
|
585
484
|
};
|
|
586
485
|
};
|
|
587
486
|
const unmarshalGetPlacementGroupServersResponse = data => {
|
|
@@ -597,7 +496,7 @@ const unmarshalGetPrivateNICResponse = data => {
|
|
|
597
496
|
throw new TypeError(`Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`);
|
|
598
497
|
}
|
|
599
498
|
return {
|
|
600
|
-
privateNic:
|
|
499
|
+
privateNic: unmarshalPrivateNIC(data.private_nic)
|
|
601
500
|
};
|
|
602
501
|
};
|
|
603
502
|
const unmarshalGetSecurityGroupResponse = data => {
|
|
@@ -605,7 +504,7 @@ const unmarshalGetSecurityGroupResponse = data => {
|
|
|
605
504
|
throw new TypeError(`Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`);
|
|
606
505
|
}
|
|
607
506
|
return {
|
|
608
|
-
securityGroup:
|
|
507
|
+
securityGroup: unmarshalSecurityGroup(data.security_group)
|
|
609
508
|
};
|
|
610
509
|
};
|
|
611
510
|
const unmarshalGetSecurityGroupRuleResponse = data => {
|
|
@@ -613,7 +512,7 @@ const unmarshalGetSecurityGroupRuleResponse = data => {
|
|
|
613
512
|
throw new TypeError(`Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
|
|
614
513
|
}
|
|
615
514
|
return {
|
|
616
|
-
rule:
|
|
515
|
+
rule: unmarshalSecurityGroupRule(data.rule)
|
|
617
516
|
};
|
|
618
517
|
};
|
|
619
518
|
const unmarshalGetServerResponse = data => {
|
|
@@ -621,7 +520,15 @@ const unmarshalGetServerResponse = data => {
|
|
|
621
520
|
throw new TypeError(`Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`);
|
|
622
521
|
}
|
|
623
522
|
return {
|
|
624
|
-
server:
|
|
523
|
+
server: unmarshalServer(data.server)
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
const unmarshalGetServerTypesAvailabilityResponseAvailability = data => {
|
|
527
|
+
if (!isJSONObject(data)) {
|
|
528
|
+
throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`);
|
|
529
|
+
}
|
|
530
|
+
return {
|
|
531
|
+
availability: data.availability
|
|
625
532
|
};
|
|
626
533
|
};
|
|
627
534
|
const unmarshalGetServerTypesAvailabilityResponse = data => {
|
|
@@ -638,7 +545,7 @@ const unmarshalGetSnapshotResponse = data => {
|
|
|
638
545
|
throw new TypeError(`Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`);
|
|
639
546
|
}
|
|
640
547
|
return {
|
|
641
|
-
snapshot:
|
|
548
|
+
snapshot: unmarshalSnapshot(data.snapshot)
|
|
642
549
|
};
|
|
643
550
|
};
|
|
644
551
|
const unmarshalGetVolumeResponse = data => {
|
|
@@ -646,7 +553,7 @@ const unmarshalGetVolumeResponse = data => {
|
|
|
646
553
|
throw new TypeError(`Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`);
|
|
647
554
|
}
|
|
648
555
|
return {
|
|
649
|
-
volume:
|
|
556
|
+
volume: unmarshalVolume(data.volume)
|
|
650
557
|
};
|
|
651
558
|
};
|
|
652
559
|
const unmarshalListBootscriptsResponse = data => {
|
|
@@ -737,6 +644,72 @@ const unmarshalListServersResponse = data => {
|
|
|
737
644
|
totalCount: data.total_count
|
|
738
645
|
};
|
|
739
646
|
};
|
|
647
|
+
const unmarshalServerTypeCapabilities = data => {
|
|
648
|
+
if (!isJSONObject(data)) {
|
|
649
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`);
|
|
650
|
+
}
|
|
651
|
+
return {
|
|
652
|
+
blockStorage: data.block_storage ? data.block_storage : undefined,
|
|
653
|
+
bootTypes: data.boot_types
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
const unmarshalServerTypeNetworkInterface = data => {
|
|
657
|
+
if (!isJSONObject(data)) {
|
|
658
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`);
|
|
659
|
+
}
|
|
660
|
+
return {
|
|
661
|
+
internalBandwidth: data.internal_bandwidth ? data.internal_bandwidth : undefined,
|
|
662
|
+
internetBandwidth: data.internet_bandwidth ? data.internet_bandwidth : undefined
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
const unmarshalServerTypeNetwork = data => {
|
|
666
|
+
if (!isJSONObject(data)) {
|
|
667
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`);
|
|
668
|
+
}
|
|
669
|
+
return {
|
|
670
|
+
interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface),
|
|
671
|
+
ipv6Support: data.ipv6_support,
|
|
672
|
+
sumInternalBandwidth: data.sum_internal_bandwidth ? data.sum_internal_bandwidth : undefined,
|
|
673
|
+
sumInternetBandwidth: data.sum_internet_bandwidth ? data.sum_internet_bandwidth : undefined
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
const unmarshalServerTypeVolumeConstraintSizes = data => {
|
|
677
|
+
if (!isJSONObject(data)) {
|
|
678
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
|
|
679
|
+
}
|
|
680
|
+
return {
|
|
681
|
+
maxSize: data.max_size,
|
|
682
|
+
minSize: data.min_size
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
const unmarshalServerTypeVolumeConstraintsByType = data => {
|
|
686
|
+
if (!isJSONObject(data)) {
|
|
687
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`);
|
|
688
|
+
}
|
|
689
|
+
return {
|
|
690
|
+
lSsd: unmarshalServerTypeVolumeConstraintSizes(data.l_ssd)
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
const unmarshalServerType = data => {
|
|
694
|
+
if (!isJSONObject(data)) {
|
|
695
|
+
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
696
|
+
}
|
|
697
|
+
return {
|
|
698
|
+
altNames: data.alt_names,
|
|
699
|
+
arch: data.arch,
|
|
700
|
+
baremetal: data.baremetal,
|
|
701
|
+
capabilities: unmarshalServerTypeCapabilities(data.capabilities),
|
|
702
|
+
gpu: data.gpu ? data.gpu : undefined,
|
|
703
|
+
hourlyPrice: data.hourly_price,
|
|
704
|
+
monthlyPrice: data.monthly_price ? data.monthly_price : undefined,
|
|
705
|
+
ncpus: data.ncpus,
|
|
706
|
+
network: unmarshalServerTypeNetwork(data.network),
|
|
707
|
+
perVolumeConstraint: unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint),
|
|
708
|
+
ram: data.ram,
|
|
709
|
+
scratchStorageMaxSize: data.scratch_storage_max_size ? data.scratch_storage_max_size : undefined,
|
|
710
|
+
volumesConstraint: unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint)
|
|
711
|
+
};
|
|
712
|
+
};
|
|
740
713
|
const unmarshalListServersTypesResponse = data => {
|
|
741
714
|
if (!isJSONObject(data)) {
|
|
742
715
|
throw new TypeError(`Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`);
|
|
@@ -764,6 +737,33 @@ const unmarshalListVolumesResponse = data => {
|
|
|
764
737
|
volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
|
|
765
738
|
};
|
|
766
739
|
};
|
|
740
|
+
const unmarshalVolumeTypeConstraints = data => {
|
|
741
|
+
if (!isJSONObject(data)) {
|
|
742
|
+
throw new TypeError(`Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`);
|
|
743
|
+
}
|
|
744
|
+
return {
|
|
745
|
+
max: data.max,
|
|
746
|
+
min: data.min
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
const unmarshalVolumeTypeCapabilities = data => {
|
|
750
|
+
if (!isJSONObject(data)) {
|
|
751
|
+
throw new TypeError(`Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`);
|
|
752
|
+
}
|
|
753
|
+
return {
|
|
754
|
+
snapshot: data.snapshot
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
const unmarshalVolumeType = data => {
|
|
758
|
+
if (!isJSONObject(data)) {
|
|
759
|
+
throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
capabilities: unmarshalVolumeTypeCapabilities(data.capabilities),
|
|
763
|
+
constraints: unmarshalVolumeTypeConstraints(data.constraints),
|
|
764
|
+
displayName: data.display_name
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
767
|
const unmarshalListVolumesTypesResponse = data => {
|
|
768
768
|
if (!isJSONObject(data)) {
|
|
769
769
|
throw new TypeError(`Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`);
|
|
@@ -780,7 +780,7 @@ const unmarshalMigrationPlan = data => {
|
|
|
780
780
|
return {
|
|
781
781
|
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
782
782
|
validationKey: data.validation_key,
|
|
783
|
-
volume:
|
|
783
|
+
volume: unmarshalVolume(data.volume)
|
|
784
784
|
};
|
|
785
785
|
};
|
|
786
786
|
const unmarshalServerActionResponse = data => {
|
|
@@ -788,7 +788,7 @@ const unmarshalServerActionResponse = data => {
|
|
|
788
788
|
throw new TypeError(`Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`);
|
|
789
789
|
}
|
|
790
790
|
return {
|
|
791
|
-
task:
|
|
791
|
+
task: unmarshalTask(data.task)
|
|
792
792
|
};
|
|
793
793
|
};
|
|
794
794
|
const unmarshalSetImageResponse = data => {
|
|
@@ -796,7 +796,7 @@ const unmarshalSetImageResponse = data => {
|
|
|
796
796
|
throw new TypeError(`Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`);
|
|
797
797
|
}
|
|
798
798
|
return {
|
|
799
|
-
image:
|
|
799
|
+
image: unmarshalImage(data.image)
|
|
800
800
|
};
|
|
801
801
|
};
|
|
802
802
|
const unmarshalSetPlacementGroupResponse = data => {
|
|
@@ -804,7 +804,7 @@ const unmarshalSetPlacementGroupResponse = data => {
|
|
|
804
804
|
throw new TypeError(`Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`);
|
|
805
805
|
}
|
|
806
806
|
return {
|
|
807
|
-
placementGroup:
|
|
807
|
+
placementGroup: unmarshalPlacementGroup(data.placement_group)
|
|
808
808
|
};
|
|
809
809
|
};
|
|
810
810
|
const unmarshalSetPlacementGroupServersResponse = data => {
|
|
@@ -820,7 +820,7 @@ const unmarshalSetSecurityGroupResponse = data => {
|
|
|
820
820
|
throw new TypeError(`Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`);
|
|
821
821
|
}
|
|
822
822
|
return {
|
|
823
|
-
securityGroup:
|
|
823
|
+
securityGroup: unmarshalSecurityGroup(data.security_group)
|
|
824
824
|
};
|
|
825
825
|
};
|
|
826
826
|
const unmarshalSetSecurityGroupRuleResponse = data => {
|
|
@@ -828,7 +828,7 @@ const unmarshalSetSecurityGroupRuleResponse = data => {
|
|
|
828
828
|
throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
|
|
829
829
|
}
|
|
830
830
|
return {
|
|
831
|
-
rule:
|
|
831
|
+
rule: unmarshalSecurityGroupRule(data.rule)
|
|
832
832
|
};
|
|
833
833
|
};
|
|
834
834
|
const unmarshalSetSecurityGroupRulesResponse = data => {
|
|
@@ -844,7 +844,7 @@ const unmarshalSetServerResponse = data => {
|
|
|
844
844
|
throw new TypeError(`Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`);
|
|
845
845
|
}
|
|
846
846
|
return {
|
|
847
|
-
server:
|
|
847
|
+
server: unmarshalServer(data.server)
|
|
848
848
|
};
|
|
849
849
|
};
|
|
850
850
|
const unmarshalSetSnapshotResponse = data => {
|
|
@@ -852,7 +852,7 @@ const unmarshalSetSnapshotResponse = data => {
|
|
|
852
852
|
throw new TypeError(`Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`);
|
|
853
853
|
}
|
|
854
854
|
return {
|
|
855
|
-
snapshot:
|
|
855
|
+
snapshot: unmarshalSnapshot(data.snapshot)
|
|
856
856
|
};
|
|
857
857
|
};
|
|
858
858
|
const unmarshalUpdateIpResponse = data => {
|
|
@@ -860,7 +860,7 @@ const unmarshalUpdateIpResponse = data => {
|
|
|
860
860
|
throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`);
|
|
861
861
|
}
|
|
862
862
|
return {
|
|
863
|
-
ip:
|
|
863
|
+
ip: unmarshalIp(data.ip)
|
|
864
864
|
};
|
|
865
865
|
};
|
|
866
866
|
const unmarshalUpdatePlacementGroupResponse = data => {
|
|
@@ -868,7 +868,7 @@ const unmarshalUpdatePlacementGroupResponse = data => {
|
|
|
868
868
|
throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`);
|
|
869
869
|
}
|
|
870
870
|
return {
|
|
871
|
-
placementGroup:
|
|
871
|
+
placementGroup: unmarshalPlacementGroup(data.placement_group)
|
|
872
872
|
};
|
|
873
873
|
};
|
|
874
874
|
const unmarshalUpdatePlacementGroupServersResponse = data => {
|
|
@@ -884,7 +884,7 @@ const unmarshalUpdateServerResponse = data => {
|
|
|
884
884
|
throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`);
|
|
885
885
|
}
|
|
886
886
|
return {
|
|
887
|
-
server:
|
|
887
|
+
server: unmarshalServer(data.server)
|
|
888
888
|
};
|
|
889
889
|
};
|
|
890
890
|
const unmarshalUpdateVolumeResponse = data => {
|
|
@@ -892,225 +892,58 @@ const unmarshalUpdateVolumeResponse = data => {
|
|
|
892
892
|
throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`);
|
|
893
893
|
}
|
|
894
894
|
return {
|
|
895
|
-
volume:
|
|
895
|
+
volume: unmarshalVolume(data.volume)
|
|
896
896
|
};
|
|
897
897
|
};
|
|
898
|
-
const marshalServerSummary = (request, defaults) => ({
|
|
899
|
-
id: request.id,
|
|
900
|
-
name: request.name
|
|
901
|
-
});
|
|
902
|
-
const marshalBootscript = (request, defaults) => ({
|
|
903
|
-
arch: request.arch,
|
|
904
|
-
bootcmdargs: request.bootcmdargs,
|
|
905
|
-
default: request.default,
|
|
906
|
-
dtb: request.dtb,
|
|
907
|
-
id: request.id,
|
|
908
|
-
initrd: request.initrd,
|
|
909
|
-
kernel: request.kernel,
|
|
910
|
-
organization: request.organization,
|
|
911
|
-
project: request.project,
|
|
912
|
-
public: request.public,
|
|
913
|
-
title: request.title,
|
|
914
|
-
zone: request.zone
|
|
915
|
-
});
|
|
916
|
-
const marshalVolume = (request, defaults) => ({
|
|
917
|
-
creation_date: request.creationDate,
|
|
918
|
-
export_uri: request.exportUri,
|
|
919
|
-
id: request.id,
|
|
920
|
-
modification_date: request.modificationDate,
|
|
921
|
-
name: request.name,
|
|
922
|
-
organization: request.organization,
|
|
923
|
-
project: request.project,
|
|
924
|
-
server: request.server ? marshalServerSummary(request.server) : undefined,
|
|
925
|
-
size: request.size,
|
|
926
|
-
state: request.state,
|
|
927
|
-
tags: request.tags,
|
|
928
|
-
volume_type: request.volumeType,
|
|
929
|
-
zone: request.zone
|
|
930
|
-
});
|
|
931
|
-
const marshalVolumeSummary = (request, defaults) => ({
|
|
932
|
-
id: request.id,
|
|
933
|
-
name: request.name,
|
|
934
|
-
size: request.size,
|
|
935
|
-
volume_type: request.volumeType
|
|
936
|
-
});
|
|
937
|
-
const marshalImage = (request, defaults) => ({
|
|
938
|
-
arch: request.arch,
|
|
939
|
-
creation_date: request.creationDate,
|
|
940
|
-
default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
941
|
-
extra_volumes: Object.entries(request.extraVolumes).reduce((acc, _ref) => {
|
|
942
|
-
let [key, value] = _ref;
|
|
943
|
-
return {
|
|
944
|
-
...acc,
|
|
945
|
-
[key]: marshalVolume(value)
|
|
946
|
-
};
|
|
947
|
-
}, {}),
|
|
948
|
-
from_server: request.fromServer,
|
|
949
|
-
id: request.id,
|
|
950
|
-
modification_date: request.modificationDate,
|
|
951
|
-
name: request.name,
|
|
952
|
-
organization: request.organization,
|
|
953
|
-
project: request.project,
|
|
954
|
-
public: request.public,
|
|
955
|
-
root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
956
|
-
state: request.state,
|
|
957
|
-
tags: request.tags,
|
|
958
|
-
zone: request.zone
|
|
959
|
-
});
|
|
960
|
-
const marshalPlacementGroup = (request, defaults) => ({
|
|
961
|
-
id: request.id,
|
|
962
|
-
name: request.name,
|
|
963
|
-
organization: request.organization,
|
|
964
|
-
policy_mode: request.policyMode,
|
|
965
|
-
policy_respected: request.policyRespected,
|
|
966
|
-
policy_type: request.policyType,
|
|
967
|
-
project: request.project,
|
|
968
|
-
tags: request.tags,
|
|
969
|
-
zone: request.zone
|
|
970
|
-
});
|
|
971
|
-
const marshalPrivateNIC = (request, defaults) => ({
|
|
972
|
-
id: request.id,
|
|
973
|
-
mac_address: request.macAddress,
|
|
974
|
-
private_network_id: request.privateNetworkId,
|
|
975
|
-
server_id: request.serverId,
|
|
976
|
-
state: request.state,
|
|
977
|
-
tags: request.tags
|
|
978
|
-
});
|
|
979
|
-
const marshalSecurityGroupSummary = (request, defaults) => ({
|
|
980
|
-
id: request.id,
|
|
981
|
-
name: request.name
|
|
982
|
-
});
|
|
983
|
-
const marshalSecurityGroupTemplate = (request, defaults) => ({
|
|
984
|
-
id: request.id,
|
|
985
|
-
name: request.name
|
|
986
|
-
});
|
|
987
|
-
const marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({
|
|
988
|
-
volume_type: request.volumeType
|
|
989
|
-
});
|
|
990
|
-
const marshalServerIp = (request, defaults) => ({
|
|
991
|
-
address: request.address,
|
|
992
|
-
dynamic: request.dynamic,
|
|
993
|
-
family: request.family,
|
|
994
|
-
gateway: request.gateway,
|
|
995
|
-
id: request.id,
|
|
996
|
-
netmask: request.netmask,
|
|
997
|
-
provisioning_mode: request.provisioningMode
|
|
998
|
-
});
|
|
999
|
-
const marshalServerIpv6 = (request, defaults) => ({
|
|
1000
|
-
address: request.address,
|
|
1001
|
-
gateway: request.gateway,
|
|
1002
|
-
netmask: request.netmask
|
|
1003
|
-
});
|
|
1004
|
-
const marshalServerLocation = (request, defaults) => ({
|
|
1005
|
-
cluster_id: request.clusterId,
|
|
1006
|
-
hypervisor_id: request.hypervisorId,
|
|
1007
|
-
node_id: request.nodeId,
|
|
1008
|
-
platform_id: request.platformId,
|
|
1009
|
-
zone_id: request.zoneId
|
|
1010
|
-
});
|
|
1011
|
-
const marshalServerMaintenance = (request, defaults) => ({
|
|
1012
|
-
reason: request.reason
|
|
1013
|
-
});
|
|
1014
|
-
const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({
|
|
1015
|
-
action: request.action,
|
|
1016
|
-
dest_port_from: request.destPortFrom,
|
|
1017
|
-
dest_port_to: request.destPortTo,
|
|
1018
|
-
direction: request.direction,
|
|
1019
|
-
editable: request.editable,
|
|
1020
|
-
id: request.id,
|
|
1021
|
-
ip_range: request.ipRange,
|
|
1022
|
-
position: request.position,
|
|
1023
|
-
protocol: request.protocol,
|
|
1024
|
-
zone: request.zone
|
|
1025
|
-
});
|
|
1026
|
-
const marshalSnapshotBaseVolume = (request, defaults) => ({
|
|
1027
|
-
id: request.id,
|
|
1028
|
-
name: request.name
|
|
1029
|
-
});
|
|
1030
|
-
const marshalVolumeServerTemplate = (request, defaults) => ({
|
|
1031
|
-
base_snapshot: request.baseSnapshot,
|
|
1032
|
-
boot: request.boot,
|
|
1033
|
-
id: request.id,
|
|
1034
|
-
name: request.name,
|
|
1035
|
-
organization: request.organization,
|
|
1036
|
-
project: request.project,
|
|
1037
|
-
size: request.size,
|
|
1038
|
-
volume_type: request.volumeType
|
|
1039
|
-
});
|
|
1040
|
-
const marshalVolumeTemplate = (request, defaults) => ({
|
|
1041
|
-
id: request.id,
|
|
1042
|
-
name: request.name,
|
|
1043
|
-
size: request.size,
|
|
1044
|
-
volume_type: request.volumeType,
|
|
1045
|
-
...resolveOneOf([{
|
|
1046
|
-
param: 'project',
|
|
1047
|
-
value: request.project
|
|
1048
|
-
}, {
|
|
1049
|
-
param: 'organization',
|
|
1050
|
-
value: request.organization
|
|
1051
|
-
}])
|
|
1052
|
-
});
|
|
1053
898
|
const marshalApplyBlockMigrationRequest = (request, defaults) => ({
|
|
1054
899
|
validation_key: request.validationKey,
|
|
1055
900
|
...resolveOneOf([{
|
|
1056
|
-
param: 'volume_id',
|
|
1057
|
-
value: request.volumeId
|
|
1058
|
-
}, {
|
|
1059
901
|
param: 'snapshot_id',
|
|
1060
902
|
value: request.snapshotId
|
|
903
|
+
}, {
|
|
904
|
+
param: 'volume_id',
|
|
905
|
+
value: request.volumeId
|
|
1061
906
|
}])
|
|
1062
907
|
});
|
|
1063
908
|
const marshalCreateImageRequest = (request, defaults) => ({
|
|
1064
909
|
arch: request.arch,
|
|
1065
910
|
default_bootscript: request.defaultBootscript,
|
|
1066
|
-
extra_volumes: request.extraVolumes
|
|
1067
|
-
let [key, value] = _ref2;
|
|
1068
|
-
return {
|
|
1069
|
-
...acc,
|
|
1070
|
-
[key]: marshalVolumeTemplate(value)
|
|
1071
|
-
};
|
|
1072
|
-
}, {}) : undefined,
|
|
911
|
+
extra_volumes: request.extraVolumes,
|
|
1073
912
|
name: request.name || randomName('img'),
|
|
1074
913
|
public: request.public,
|
|
1075
914
|
root_volume: request.rootVolume,
|
|
1076
915
|
tags: request.tags,
|
|
1077
916
|
...resolveOneOf([{
|
|
1078
|
-
default: defaults.defaultProjectId,
|
|
1079
|
-
param: 'project',
|
|
1080
|
-
value: request.project
|
|
1081
|
-
}, {
|
|
1082
|
-
default: defaults.defaultOrganizationId,
|
|
1083
917
|
param: 'organization',
|
|
1084
918
|
value: request.organization
|
|
919
|
+
}, {
|
|
920
|
+
param: 'project',
|
|
921
|
+
value: request.project
|
|
1085
922
|
}])
|
|
1086
923
|
});
|
|
1087
924
|
const marshalCreateIpRequest = (request, defaults) => ({
|
|
1088
925
|
server: request.server,
|
|
1089
926
|
tags: request.tags,
|
|
1090
|
-
type: request.type
|
|
927
|
+
type: request.type,
|
|
1091
928
|
...resolveOneOf([{
|
|
1092
|
-
default: defaults.defaultProjectId,
|
|
1093
|
-
param: 'project',
|
|
1094
|
-
value: request.project
|
|
1095
|
-
}, {
|
|
1096
|
-
default: defaults.defaultOrganizationId,
|
|
1097
929
|
param: 'organization',
|
|
1098
930
|
value: request.organization
|
|
931
|
+
}, {
|
|
932
|
+
param: 'project',
|
|
933
|
+
value: request.project
|
|
1099
934
|
}])
|
|
1100
935
|
});
|
|
1101
936
|
const marshalCreatePlacementGroupRequest = (request, defaults) => ({
|
|
1102
937
|
name: request.name || randomName('pg'),
|
|
1103
|
-
policy_mode: request.policyMode
|
|
1104
|
-
policy_type: request.policyType
|
|
938
|
+
policy_mode: request.policyMode,
|
|
939
|
+
policy_type: request.policyType,
|
|
1105
940
|
tags: request.tags,
|
|
1106
941
|
...resolveOneOf([{
|
|
1107
|
-
default: defaults.defaultProjectId,
|
|
1108
|
-
param: 'project',
|
|
1109
|
-
value: request.project
|
|
1110
|
-
}, {
|
|
1111
|
-
default: defaults.defaultOrganizationId,
|
|
1112
942
|
param: 'organization',
|
|
1113
943
|
value: request.organization
|
|
944
|
+
}, {
|
|
945
|
+
param: 'project',
|
|
946
|
+
value: request.project
|
|
1114
947
|
}])
|
|
1115
948
|
});
|
|
1116
949
|
const marshalCreatePrivateNICRequest = (request, defaults) => ({
|
|
@@ -1121,26 +954,24 @@ const marshalCreatePrivateNICRequest = (request, defaults) => ({
|
|
|
1121
954
|
const marshalCreateSecurityGroupRequest = (request, defaults) => ({
|
|
1122
955
|
description: request.description,
|
|
1123
956
|
enable_default_security: request.enableDefaultSecurity,
|
|
1124
|
-
inbound_default_policy: request.inboundDefaultPolicy
|
|
957
|
+
inbound_default_policy: request.inboundDefaultPolicy,
|
|
1125
958
|
name: request.name || randomName('sg'),
|
|
1126
|
-
outbound_default_policy: request.outboundDefaultPolicy
|
|
959
|
+
outbound_default_policy: request.outboundDefaultPolicy,
|
|
1127
960
|
stateful: request.stateful,
|
|
1128
961
|
tags: request.tags,
|
|
962
|
+
...resolveOneOf([{
|
|
963
|
+
param: 'organization',
|
|
964
|
+
value: request.organization
|
|
965
|
+
}, {
|
|
966
|
+
param: 'project',
|
|
967
|
+
value: request.project
|
|
968
|
+
}]),
|
|
1129
969
|
...resolveOneOf([{
|
|
1130
970
|
param: 'organization_default',
|
|
1131
971
|
value: request.organizationDefault
|
|
1132
972
|
}, {
|
|
1133
973
|
param: 'project_default',
|
|
1134
974
|
value: request.projectDefault
|
|
1135
|
-
}]),
|
|
1136
|
-
...resolveOneOf([{
|
|
1137
|
-
default: defaults.defaultProjectId,
|
|
1138
|
-
param: 'project',
|
|
1139
|
-
value: request.project
|
|
1140
|
-
}, {
|
|
1141
|
-
default: defaults.defaultOrganizationId,
|
|
1142
|
-
param: 'organization',
|
|
1143
|
-
value: request.organization
|
|
1144
975
|
}])
|
|
1145
976
|
});
|
|
1146
977
|
const marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({
|
|
@@ -1167,21 +998,13 @@ const marshalCreateServerRequest = (request, defaults) => ({
|
|
|
1167
998
|
routed_ip_enabled: request.routedIpEnabled,
|
|
1168
999
|
security_group: request.securityGroup,
|
|
1169
1000
|
tags: request.tags,
|
|
1170
|
-
volumes: request.volumes
|
|
1171
|
-
let [key, value] = _ref3;
|
|
1172
|
-
return {
|
|
1173
|
-
...acc,
|
|
1174
|
-
[key]: marshalVolumeServerTemplate(value)
|
|
1175
|
-
};
|
|
1176
|
-
}, {}) : undefined,
|
|
1001
|
+
volumes: request.volumes,
|
|
1177
1002
|
...resolveOneOf([{
|
|
1178
|
-
default: defaults.defaultProjectId,
|
|
1179
|
-
param: 'project',
|
|
1180
|
-
value: request.project
|
|
1181
|
-
}, {
|
|
1182
|
-
default: defaults.defaultOrganizationId,
|
|
1183
1003
|
param: 'organization',
|
|
1184
1004
|
value: request.organization
|
|
1005
|
+
}, {
|
|
1006
|
+
param: 'project',
|
|
1007
|
+
value: request.project
|
|
1185
1008
|
}])
|
|
1186
1009
|
});
|
|
1187
1010
|
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
@@ -1191,39 +1014,35 @@ const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
|
1191
1014
|
size: request.size,
|
|
1192
1015
|
tags: request.tags,
|
|
1193
1016
|
volume_id: request.volumeId,
|
|
1194
|
-
volume_type: request.volumeType
|
|
1017
|
+
volume_type: request.volumeType,
|
|
1195
1018
|
...resolveOneOf([{
|
|
1196
|
-
default: defaults.defaultProjectId,
|
|
1197
|
-
param: 'project',
|
|
1198
|
-
value: request.project
|
|
1199
|
-
}, {
|
|
1200
|
-
default: defaults.defaultOrganizationId,
|
|
1201
1019
|
param: 'organization',
|
|
1202
1020
|
value: request.organization
|
|
1021
|
+
}, {
|
|
1022
|
+
param: 'project',
|
|
1023
|
+
value: request.project
|
|
1203
1024
|
}])
|
|
1204
1025
|
});
|
|
1205
1026
|
const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
1206
1027
|
name: request.name || randomName('vol'),
|
|
1207
1028
|
tags: request.tags,
|
|
1208
|
-
volume_type: request.volumeType
|
|
1029
|
+
volume_type: request.volumeType,
|
|
1209
1030
|
...resolveOneOf([{
|
|
1210
|
-
default: defaults.defaultProjectId,
|
|
1211
|
-
param: 'project',
|
|
1212
|
-
value: request.project
|
|
1213
|
-
}, {
|
|
1214
|
-
default: defaults.defaultOrganizationId,
|
|
1215
1031
|
param: 'organization',
|
|
1216
1032
|
value: request.organization
|
|
1033
|
+
}, {
|
|
1034
|
+
param: 'project',
|
|
1035
|
+
value: request.project
|
|
1217
1036
|
}]),
|
|
1218
1037
|
...resolveOneOf([{
|
|
1219
|
-
param: '
|
|
1220
|
-
value: request.
|
|
1038
|
+
param: 'base_snapshot',
|
|
1039
|
+
value: request.baseSnapshot
|
|
1221
1040
|
}, {
|
|
1222
1041
|
param: 'base_volume',
|
|
1223
1042
|
value: request.baseVolume
|
|
1224
1043
|
}, {
|
|
1225
|
-
param: '
|
|
1226
|
-
value: request.
|
|
1044
|
+
param: 'size',
|
|
1045
|
+
value: request.size
|
|
1227
1046
|
}])
|
|
1228
1047
|
});
|
|
1229
1048
|
const marshalExportSnapshotRequest = (request, defaults) => ({
|
|
@@ -1232,51 +1051,39 @@ const marshalExportSnapshotRequest = (request, defaults) => ({
|
|
|
1232
1051
|
});
|
|
1233
1052
|
const marshalPlanBlockMigrationRequest = (request, defaults) => ({
|
|
1234
1053
|
...resolveOneOf([{
|
|
1235
|
-
param: 'volume_id',
|
|
1236
|
-
value: request.volumeId
|
|
1237
|
-
}, {
|
|
1238
1054
|
param: 'snapshot_id',
|
|
1239
1055
|
value: request.snapshotId
|
|
1056
|
+
}, {
|
|
1057
|
+
param: 'volume_id',
|
|
1058
|
+
value: request.volumeId
|
|
1240
1059
|
}])
|
|
1241
1060
|
});
|
|
1242
1061
|
const marshalServerActionRequest = (request, defaults) => ({
|
|
1243
|
-
action: request.action
|
|
1062
|
+
action: request.action,
|
|
1244
1063
|
name: request.name,
|
|
1245
|
-
volumes: request.volumes
|
|
1246
|
-
let [key, value] = _ref4;
|
|
1247
|
-
return {
|
|
1248
|
-
...acc,
|
|
1249
|
-
[key]: marshalServerActionRequestVolumeBackupTemplate(value)
|
|
1250
|
-
};
|
|
1251
|
-
}, {}) : undefined
|
|
1064
|
+
volumes: request.volumes
|
|
1252
1065
|
});
|
|
1253
1066
|
const marshalSetImageRequest = (request, defaults) => ({
|
|
1254
1067
|
arch: request.arch,
|
|
1255
1068
|
creation_date: request.creationDate,
|
|
1256
|
-
default_bootscript: request.defaultBootscript
|
|
1257
|
-
extra_volumes: request.extraVolumes
|
|
1258
|
-
let [key, value] = _ref5;
|
|
1259
|
-
return {
|
|
1260
|
-
...acc,
|
|
1261
|
-
[key]: marshalVolume(value)
|
|
1262
|
-
};
|
|
1263
|
-
}, {}) : undefined,
|
|
1069
|
+
default_bootscript: request.defaultBootscript,
|
|
1070
|
+
extra_volumes: request.extraVolumes,
|
|
1264
1071
|
from_server: request.fromServer,
|
|
1265
1072
|
modification_date: request.modificationDate,
|
|
1266
1073
|
name: request.name,
|
|
1267
|
-
organization: request.organization,
|
|
1268
|
-
project: request.project,
|
|
1074
|
+
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
1075
|
+
project: request.project ?? defaults.defaultProjectId,
|
|
1269
1076
|
public: request.public,
|
|
1270
|
-
root_volume: request.rootVolume
|
|
1077
|
+
root_volume: request.rootVolume,
|
|
1271
1078
|
state: request.state,
|
|
1272
1079
|
tags: request.tags
|
|
1273
1080
|
});
|
|
1274
1081
|
const marshalSetPlacementGroupRequest = (request, defaults) => ({
|
|
1275
1082
|
name: request.name,
|
|
1276
|
-
organization: request.organization,
|
|
1083
|
+
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
1277
1084
|
policy_mode: request.policyMode,
|
|
1278
1085
|
policy_type: request.policyType,
|
|
1279
|
-
project: request.project,
|
|
1086
|
+
project: request.project ?? defaults.defaultProjectId,
|
|
1280
1087
|
tags: request.tags
|
|
1281
1088
|
});
|
|
1282
1089
|
const marshalSetPlacementGroupServersRequest = (request, defaults) => ({
|
|
@@ -1289,12 +1096,12 @@ const marshalSetSecurityGroupRequest = (request, defaults) => ({
|
|
|
1289
1096
|
inbound_default_policy: request.inboundDefaultPolicy,
|
|
1290
1097
|
modification_date: request.modificationDate,
|
|
1291
1098
|
name: request.name,
|
|
1292
|
-
organization: request.organization,
|
|
1099
|
+
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
1293
1100
|
organization_default: request.organizationDefault,
|
|
1294
1101
|
outbound_default_policy: request.outboundDefaultPolicy,
|
|
1295
|
-
project: request.project,
|
|
1102
|
+
project: request.project ?? defaults.defaultProjectId,
|
|
1296
1103
|
project_default: request.projectDefault,
|
|
1297
|
-
servers: request.servers
|
|
1104
|
+
servers: request.servers,
|
|
1298
1105
|
stateful: request.stateful,
|
|
1299
1106
|
tags: request.tags
|
|
1300
1107
|
});
|
|
@@ -1310,53 +1117,47 @@ const marshalSetSecurityGroupRuleRequest = (request, defaults) => ({
|
|
|
1310
1117
|
protocol: request.protocol
|
|
1311
1118
|
});
|
|
1312
1119
|
const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({
|
|
1313
|
-
rules: request.rules
|
|
1120
|
+
rules: request.rules
|
|
1314
1121
|
});
|
|
1315
1122
|
const marshalSetServerRequest = (request, defaults) => ({
|
|
1316
1123
|
allowed_actions: request.allowedActions,
|
|
1317
1124
|
arch: request.arch,
|
|
1318
1125
|
boot_type: request.bootType,
|
|
1319
|
-
bootscript: request.bootscript
|
|
1126
|
+
bootscript: request.bootscript,
|
|
1320
1127
|
commercial_type: request.commercialType,
|
|
1321
1128
|
creation_date: request.creationDate,
|
|
1322
1129
|
dynamic_ip_required: request.dynamicIpRequired,
|
|
1323
1130
|
enable_ipv6: request.enableIpv6,
|
|
1324
1131
|
hostname: request.hostname,
|
|
1325
|
-
image: request.image
|
|
1326
|
-
ipv6: request.ipv6
|
|
1327
|
-
location: request.location
|
|
1328
|
-
maintenances: request.maintenances
|
|
1132
|
+
image: request.image,
|
|
1133
|
+
ipv6: request.ipv6,
|
|
1134
|
+
location: request.location,
|
|
1135
|
+
maintenances: request.maintenances,
|
|
1329
1136
|
modification_date: request.modificationDate,
|
|
1330
1137
|
name: request.name,
|
|
1331
|
-
organization: request.organization,
|
|
1332
|
-
placement_group: request.placementGroup
|
|
1138
|
+
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
1139
|
+
placement_group: request.placementGroup,
|
|
1333
1140
|
private_ip: request.privateIp,
|
|
1334
|
-
private_nics: request.privateNics
|
|
1335
|
-
project: request.project,
|
|
1141
|
+
private_nics: request.privateNics,
|
|
1142
|
+
project: request.project ?? defaults.defaultProjectId,
|
|
1336
1143
|
protected: request.protected,
|
|
1337
|
-
public_ip: request.publicIp
|
|
1338
|
-
public_ips: request.publicIps
|
|
1144
|
+
public_ip: request.publicIp,
|
|
1145
|
+
public_ips: request.publicIps,
|
|
1339
1146
|
routed_ip_enabled: request.routedIpEnabled,
|
|
1340
|
-
security_group: request.securityGroup
|
|
1147
|
+
security_group: request.securityGroup,
|
|
1341
1148
|
state: request.state,
|
|
1342
1149
|
state_detail: request.stateDetail,
|
|
1343
1150
|
tags: request.tags,
|
|
1344
|
-
volumes: request.volumes
|
|
1345
|
-
let [key, value] = _ref6;
|
|
1346
|
-
return {
|
|
1347
|
-
...acc,
|
|
1348
|
-
[key]: marshalVolume(value)
|
|
1349
|
-
};
|
|
1350
|
-
}, {}) : undefined
|
|
1151
|
+
volumes: request.volumes
|
|
1351
1152
|
});
|
|
1352
1153
|
const marshalSetSnapshotRequest = (request, defaults) => ({
|
|
1353
|
-
base_volume: request.baseVolume
|
|
1154
|
+
base_volume: request.baseVolume,
|
|
1354
1155
|
creation_date: request.creationDate,
|
|
1355
1156
|
id: request.id,
|
|
1356
1157
|
modification_date: request.modificationDate,
|
|
1357
1158
|
name: request.name,
|
|
1358
|
-
organization: request.organization,
|
|
1359
|
-
project: request.project,
|
|
1159
|
+
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
1160
|
+
project: request.project ?? defaults.defaultProjectId,
|
|
1360
1161
|
size: request.size,
|
|
1361
1162
|
state: request.state,
|
|
1362
1163
|
tags: request.tags,
|
|
@@ -1366,7 +1167,7 @@ const marshalUpdateIpRequest = (request, defaults) => ({
|
|
|
1366
1167
|
reverse: request.reverse,
|
|
1367
1168
|
server: request.server,
|
|
1368
1169
|
tags: request.tags,
|
|
1369
|
-
type: request.type
|
|
1170
|
+
type: request.type
|
|
1370
1171
|
});
|
|
1371
1172
|
const marshalUpdatePlacementGroupRequest = (request, defaults) => ({
|
|
1372
1173
|
name: request.name,
|
|
@@ -1388,19 +1189,13 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
1388
1189
|
enable_ipv6: request.enableIpv6,
|
|
1389
1190
|
name: request.name,
|
|
1390
1191
|
placement_group: request.placementGroup,
|
|
1391
|
-
private_nics: request.privateNics
|
|
1192
|
+
private_nics: request.privateNics,
|
|
1392
1193
|
protected: request.protected,
|
|
1393
|
-
public_ips: request.publicIps
|
|
1194
|
+
public_ips: request.publicIps,
|
|
1394
1195
|
routed_ip_enabled: request.routedIpEnabled,
|
|
1395
|
-
security_group: request.securityGroup
|
|
1196
|
+
security_group: request.securityGroup,
|
|
1396
1197
|
tags: request.tags,
|
|
1397
|
-
volumes: request.volumes
|
|
1398
|
-
let [key, value] = _ref7;
|
|
1399
|
-
return {
|
|
1400
|
-
...acc,
|
|
1401
|
-
[key]: marshalVolumeServerTemplate(value)
|
|
1402
|
-
};
|
|
1403
|
-
}, {}) : undefined
|
|
1198
|
+
volumes: request.volumes
|
|
1404
1199
|
});
|
|
1405
1200
|
const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
1406
1201
|
name: request.name,
|