@scaleway/sdk-autoscaling 2.2.1 → 2.3.1
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 +2 -4
- package/dist/v1alpha1/api.gen.js +185 -260
- package/dist/v1alpha1/index.gen.js +21 -19
- package/dist/v1alpha1/marshalling.gen.js +240 -325
- package/dist/v1alpha1/validation-rules.gen.js +89 -119
- package/package.json +4 -4
|
@@ -1,365 +1,280 @@
|
|
|
1
|
-
import { resolveOneOf,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cooldownDelay: data.cooldown_delay,
|
|
10
|
-
maxReplicas: data.max_replicas,
|
|
11
|
-
minReplicas: data.min_replicas
|
|
12
|
-
};
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject } from "@scaleway/sdk-client";
|
|
2
|
+
var unmarshalCapacity = (data) => {
|
|
3
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Capacity' failed as data isn't a dictionary.`);
|
|
4
|
+
return {
|
|
5
|
+
cooldownDelay: data.cooldown_delay,
|
|
6
|
+
maxReplicas: data.max_replicas,
|
|
7
|
+
minReplicas: data.min_replicas
|
|
8
|
+
};
|
|
13
9
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
backendIds: data.backend_ids,
|
|
22
|
-
id: data.id,
|
|
23
|
-
privateNetworkId: data.private_network_id
|
|
24
|
-
};
|
|
10
|
+
var unmarshalLoadbalancer = (data) => {
|
|
11
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Loadbalancer' failed as data isn't a dictionary.`);
|
|
12
|
+
return {
|
|
13
|
+
backendIds: data.backend_ids,
|
|
14
|
+
id: data.id,
|
|
15
|
+
privateNetworkId: data.private_network_id
|
|
16
|
+
};
|
|
25
17
|
};
|
|
26
18
|
const unmarshalInstanceGroup = (data) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
tags: data.tags,
|
|
42
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
43
|
-
zone: data.zone
|
|
44
|
-
};
|
|
19
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroup' failed as data isn't a dictionary.`);
|
|
20
|
+
return {
|
|
21
|
+
capacity: unmarshalCapacity(data.capacity),
|
|
22
|
+
createdAt: unmarshalDate(data.created_at),
|
|
23
|
+
errorMessages: data.error_messages,
|
|
24
|
+
id: data.id,
|
|
25
|
+
instanceTemplateId: data.instance_template_id,
|
|
26
|
+
loadbalancer: unmarshalLoadbalancer(data.loadbalancer),
|
|
27
|
+
name: data.name,
|
|
28
|
+
projectId: data.project_id,
|
|
29
|
+
tags: data.tags,
|
|
30
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
31
|
+
zone: data.zone
|
|
32
|
+
};
|
|
45
33
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
operator: data.operator,
|
|
58
|
-
samplingRangeMin: data.sampling_range_min,
|
|
59
|
-
threshold: data.threshold
|
|
60
|
-
};
|
|
34
|
+
var unmarshalMetric = (data) => {
|
|
35
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Metric' failed as data isn't a dictionary.`);
|
|
36
|
+
return {
|
|
37
|
+
aggregate: data.aggregate,
|
|
38
|
+
cockpitMetricName: data.cockpit_metric_name,
|
|
39
|
+
managedMetric: data.managed_metric ? data.managed_metric : void 0,
|
|
40
|
+
name: data.name,
|
|
41
|
+
operator: data.operator,
|
|
42
|
+
samplingRangeMin: data.sampling_range_min,
|
|
43
|
+
threshold: data.threshold
|
|
44
|
+
};
|
|
61
45
|
};
|
|
62
46
|
const unmarshalInstancePolicy = (data) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
type: data.type,
|
|
76
|
-
value: data.value,
|
|
77
|
-
zone: data.zone
|
|
78
|
-
};
|
|
47
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstancePolicy' failed as data isn't a dictionary.`);
|
|
48
|
+
return {
|
|
49
|
+
action: data.action,
|
|
50
|
+
id: data.id,
|
|
51
|
+
instanceGroupId: data.instance_group_id,
|
|
52
|
+
metric: data.metric ? unmarshalMetric(data.metric) : void 0,
|
|
53
|
+
name: data.name,
|
|
54
|
+
priority: data.priority,
|
|
55
|
+
type: data.type,
|
|
56
|
+
value: data.value,
|
|
57
|
+
zone: data.zone
|
|
58
|
+
};
|
|
79
59
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
`Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
size: data.size
|
|
88
|
-
};
|
|
60
|
+
var unmarshalVolumeInstanceTemplateFromEmpty = (data) => {
|
|
61
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`);
|
|
62
|
+
return { size: data.size };
|
|
89
63
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
size: data.size,
|
|
98
|
-
snapshotId: data.snapshot_id
|
|
99
|
-
};
|
|
64
|
+
var unmarshalVolumeInstanceTemplateFromSnapshot = (data) => {
|
|
65
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromSnapshot' failed as data isn't a dictionary.`);
|
|
66
|
+
return {
|
|
67
|
+
size: data.size,
|
|
68
|
+
snapshotId: data.snapshot_id
|
|
69
|
+
};
|
|
100
70
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
perfIops: data.perf_iops,
|
|
113
|
-
tags: data.tags,
|
|
114
|
-
volumeType: data.volume_type
|
|
115
|
-
};
|
|
71
|
+
var unmarshalVolumeInstanceTemplate = (data) => {
|
|
72
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplate' failed as data isn't a dictionary.`);
|
|
73
|
+
return {
|
|
74
|
+
boot: data.boot,
|
|
75
|
+
fromEmpty: data.from_empty ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) : void 0,
|
|
76
|
+
fromSnapshot: data.from_snapshot ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) : void 0,
|
|
77
|
+
name: data.name,
|
|
78
|
+
perfIops: data.perf_iops,
|
|
79
|
+
tags: data.tags,
|
|
80
|
+
volumeType: data.volume_type
|
|
81
|
+
};
|
|
116
82
|
};
|
|
117
83
|
const unmarshalInstanceTemplate = (data) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
139
|
-
volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate),
|
|
140
|
-
zone: data.zone
|
|
141
|
-
};
|
|
84
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceTemplate' failed as data isn't a dictionary.`);
|
|
85
|
+
return {
|
|
86
|
+
cloudInit: data.cloud_init,
|
|
87
|
+
commercialType: data.commercial_type,
|
|
88
|
+
createdAt: unmarshalDate(data.created_at),
|
|
89
|
+
id: data.id,
|
|
90
|
+
imageId: data.image_id,
|
|
91
|
+
name: data.name,
|
|
92
|
+
placementGroupId: data.placement_group_id,
|
|
93
|
+
privateNetworkIds: data.private_network_ids,
|
|
94
|
+
projectId: data.project_id,
|
|
95
|
+
publicIpsV4Count: data.public_ips_v4_count,
|
|
96
|
+
publicIpsV6Count: data.public_ips_v6_count,
|
|
97
|
+
securityGroupId: data.security_group_id,
|
|
98
|
+
status: data.status,
|
|
99
|
+
tags: data.tags,
|
|
100
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
101
|
+
volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate),
|
|
102
|
+
zone: data.zone
|
|
103
|
+
};
|
|
142
104
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
level: data.level,
|
|
154
|
-
name: data.name,
|
|
155
|
-
source: data.source
|
|
156
|
-
};
|
|
105
|
+
var unmarshalInstanceGroupEvent = (data) => {
|
|
106
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroupEvent' failed as data isn't a dictionary.`);
|
|
107
|
+
return {
|
|
108
|
+
createdAt: unmarshalDate(data.created_at),
|
|
109
|
+
details: data.details,
|
|
110
|
+
id: data.id,
|
|
111
|
+
level: data.level,
|
|
112
|
+
name: data.name,
|
|
113
|
+
source: data.source
|
|
114
|
+
};
|
|
157
115
|
};
|
|
158
116
|
const unmarshalListInstanceGroupEventsResponse = (data) => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent),
|
|
166
|
-
totalCount: data.total_count
|
|
167
|
-
};
|
|
117
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`);
|
|
118
|
+
return {
|
|
119
|
+
instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent),
|
|
120
|
+
totalCount: data.total_count
|
|
121
|
+
};
|
|
168
122
|
};
|
|
169
123
|
const unmarshalListInstanceGroupsResponse = (data) => {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup),
|
|
177
|
-
totalCount: data.total_count
|
|
178
|
-
};
|
|
124
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`);
|
|
125
|
+
return {
|
|
126
|
+
instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup),
|
|
127
|
+
totalCount: data.total_count
|
|
128
|
+
};
|
|
179
129
|
};
|
|
180
130
|
const unmarshalListInstancePoliciesResponse = (data) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
|
|
188
|
-
totalCount: data.total_count
|
|
189
|
-
};
|
|
131
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`);
|
|
132
|
+
return {
|
|
133
|
+
policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
|
|
134
|
+
totalCount: data.total_count
|
|
135
|
+
};
|
|
190
136
|
};
|
|
191
137
|
const unmarshalListInstanceTemplatesResponse = (data) => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
return {
|
|
198
|
-
instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate),
|
|
199
|
-
totalCount: data.total_count
|
|
200
|
-
};
|
|
138
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`);
|
|
139
|
+
return {
|
|
140
|
+
instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate),
|
|
141
|
+
totalCount: data.total_count
|
|
142
|
+
};
|
|
201
143
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
144
|
+
var marshalCapacity = (request, defaults) => ({
|
|
145
|
+
cooldown_delay: request.cooldownDelay,
|
|
146
|
+
max_replicas: request.maxReplicas,
|
|
147
|
+
min_replicas: request.minReplicas
|
|
206
148
|
});
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
149
|
+
var marshalLoadbalancer = (request, defaults) => ({
|
|
150
|
+
backend_ids: request.backendIds,
|
|
151
|
+
id: request.id,
|
|
152
|
+
private_network_id: request.privateNetworkId
|
|
211
153
|
});
|
|
212
154
|
const marshalCreateInstanceGroupRequest = (request, defaults) => ({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
155
|
+
capacity: marshalCapacity(request.capacity, defaults),
|
|
156
|
+
loadbalancer: marshalLoadbalancer(request.loadbalancer, defaults),
|
|
157
|
+
name: request.name,
|
|
158
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
159
|
+
tags: request.tags,
|
|
160
|
+
template_id: request.templateId
|
|
219
161
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
value: request.cockpitMetricName
|
|
234
|
-
}
|
|
235
|
-
])
|
|
162
|
+
var marshalMetric = (request, defaults) => ({
|
|
163
|
+
aggregate: request.aggregate,
|
|
164
|
+
name: request.name,
|
|
165
|
+
operator: request.operator,
|
|
166
|
+
sampling_range_min: request.samplingRangeMin,
|
|
167
|
+
threshold: request.threshold,
|
|
168
|
+
...resolveOneOf([{
|
|
169
|
+
param: "managed_metric",
|
|
170
|
+
value: request.managedMetric
|
|
171
|
+
}, {
|
|
172
|
+
param: "cockpit_metric_name",
|
|
173
|
+
value: request.cockpitMetricName
|
|
174
|
+
}])
|
|
236
175
|
});
|
|
237
176
|
const marshalCreateInstancePolicyRequest = (request, defaults) => ({
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
])
|
|
177
|
+
action: request.action,
|
|
178
|
+
instance_group_id: request.instanceGroupId,
|
|
179
|
+
name: request.name,
|
|
180
|
+
priority: request.priority,
|
|
181
|
+
type: request.type,
|
|
182
|
+
value: request.value,
|
|
183
|
+
...resolveOneOf([{
|
|
184
|
+
param: "metric",
|
|
185
|
+
value: request.metric !== void 0 ? marshalMetric(request.metric, defaults) : void 0
|
|
186
|
+
}])
|
|
250
187
|
});
|
|
251
|
-
|
|
252
|
-
|
|
188
|
+
var marshalVolumeInstanceTemplateFromEmpty = (request, defaults) => ({ size: request.size });
|
|
189
|
+
var marshalVolumeInstanceTemplateFromSnapshot = (request, defaults) => ({
|
|
190
|
+
size: request.size,
|
|
191
|
+
snapshot_id: request.snapshotId
|
|
253
192
|
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot) : void 0
|
|
271
|
-
}
|
|
272
|
-
]),
|
|
273
|
-
...resolveOneOf([
|
|
274
|
-
{
|
|
275
|
-
param: "perf_iops",
|
|
276
|
-
value: request.perfIops
|
|
277
|
-
}
|
|
278
|
-
])
|
|
193
|
+
var marshalVolumeInstanceTemplate = (request, defaults) => ({
|
|
194
|
+
boot: request.boot,
|
|
195
|
+
name: request.name,
|
|
196
|
+
tags: request.tags,
|
|
197
|
+
volume_type: request.volumeType,
|
|
198
|
+
...resolveOneOf([{
|
|
199
|
+
param: "from_empty",
|
|
200
|
+
value: request.fromEmpty !== void 0 ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty, defaults) : void 0
|
|
201
|
+
}, {
|
|
202
|
+
param: "from_snapshot",
|
|
203
|
+
value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot, defaults) : void 0
|
|
204
|
+
}]),
|
|
205
|
+
...resolveOneOf([{
|
|
206
|
+
param: "perf_iops",
|
|
207
|
+
value: request.perfIops
|
|
208
|
+
}])
|
|
279
209
|
});
|
|
280
210
|
const marshalCreateInstanceTemplateRequest = (request, defaults) => ({
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
max_replicas: request.maxReplicas,
|
|
297
|
-
min_replicas: request.minReplicas
|
|
211
|
+
cloud_init: request.cloudInit,
|
|
212
|
+
commercial_type: request.commercialType,
|
|
213
|
+
image_id: request.imageId,
|
|
214
|
+
name: request.name,
|
|
215
|
+
placement_group_id: request.placementGroupId,
|
|
216
|
+
private_network_ids: request.privateNetworkIds,
|
|
217
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
218
|
+
public_ips_v4_count: request.publicIpsV4Count,
|
|
219
|
+
public_ips_v6_count: request.publicIpsV6Count,
|
|
220
|
+
security_group_id: request.securityGroupId,
|
|
221
|
+
tags: request.tags,
|
|
222
|
+
volumes: Object.entries(request.volumes).reduce((acc, [key, value]) => ({
|
|
223
|
+
...acc,
|
|
224
|
+
[key]: marshalVolumeInstanceTemplate(value, defaults)
|
|
225
|
+
}), {})
|
|
298
226
|
});
|
|
299
|
-
|
|
300
|
-
|
|
227
|
+
var marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
|
|
228
|
+
cooldown_delay: request.cooldownDelay,
|
|
229
|
+
max_replicas: request.maxReplicas,
|
|
230
|
+
min_replicas: request.minReplicas
|
|
301
231
|
});
|
|
232
|
+
var marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({ backend_ids: request.backendIds });
|
|
302
233
|
const marshalUpdateInstanceGroupRequest = (request, defaults) => ({
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
234
|
+
capacity: request.capacity !== void 0 ? marshalUpdateInstanceGroupRequestCapacity(request.capacity, defaults) : void 0,
|
|
235
|
+
loadbalancer: request.loadbalancer !== void 0 ? marshalUpdateInstanceGroupRequestLoadbalancer(request.loadbalancer, defaults) : void 0,
|
|
236
|
+
name: request.name,
|
|
237
|
+
tags: request.tags
|
|
307
238
|
});
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
value: request.cockpitMetricName
|
|
322
|
-
}
|
|
323
|
-
])
|
|
239
|
+
var marshalUpdateInstancePolicyRequestMetric = (request, defaults) => ({
|
|
240
|
+
aggregate: request.aggregate,
|
|
241
|
+
name: request.name,
|
|
242
|
+
operator: request.operator,
|
|
243
|
+
sampling_range_min: request.samplingRangeMin,
|
|
244
|
+
threshold: request.threshold,
|
|
245
|
+
...resolveOneOf([{
|
|
246
|
+
param: "managed_metric",
|
|
247
|
+
value: request.managedMetric
|
|
248
|
+
}, {
|
|
249
|
+
param: "cockpit_metric_name",
|
|
250
|
+
value: request.cockpitMetricName
|
|
251
|
+
}])
|
|
324
252
|
});
|
|
325
253
|
const marshalUpdateInstancePolicyRequest = (request, defaults) => ({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
])
|
|
254
|
+
action: request.action,
|
|
255
|
+
name: request.name,
|
|
256
|
+
priority: request.priority,
|
|
257
|
+
type: request.type,
|
|
258
|
+
value: request.value,
|
|
259
|
+
...resolveOneOf([{
|
|
260
|
+
param: "metric",
|
|
261
|
+
value: request.metric !== void 0 ? marshalUpdateInstancePolicyRequestMetric(request.metric, defaults) : void 0
|
|
262
|
+
}])
|
|
337
263
|
});
|
|
338
264
|
const marshalUpdateInstanceTemplateRequest = (request, defaults) => ({
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
265
|
+
cloud_init: request.cloudInit,
|
|
266
|
+
commercial_type: request.commercialType,
|
|
267
|
+
image_id: request.imageId,
|
|
268
|
+
name: request.name,
|
|
269
|
+
placement_group_id: request.placementGroupId,
|
|
270
|
+
private_network_ids: request.privateNetworkIds,
|
|
271
|
+
public_ips_v4_count: request.publicIpsV4Count,
|
|
272
|
+
public_ips_v6_count: request.publicIpsV6Count,
|
|
273
|
+
security_group_id: request.securityGroupId,
|
|
274
|
+
tags: request.tags,
|
|
275
|
+
volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
|
|
276
|
+
...acc,
|
|
277
|
+
[key]: marshalVolumeInstanceTemplate(value, defaults)
|
|
278
|
+
}), {}) : void 0
|
|
350
279
|
});
|
|
351
|
-
export {
|
|
352
|
-
marshalCreateInstanceGroupRequest,
|
|
353
|
-
marshalCreateInstancePolicyRequest,
|
|
354
|
-
marshalCreateInstanceTemplateRequest,
|
|
355
|
-
marshalUpdateInstanceGroupRequest,
|
|
356
|
-
marshalUpdateInstancePolicyRequest,
|
|
357
|
-
marshalUpdateInstanceTemplateRequest,
|
|
358
|
-
unmarshalInstanceGroup,
|
|
359
|
-
unmarshalInstancePolicy,
|
|
360
|
-
unmarshalInstanceTemplate,
|
|
361
|
-
unmarshalListInstanceGroupEventsResponse,
|
|
362
|
-
unmarshalListInstanceGroupsResponse,
|
|
363
|
-
unmarshalListInstancePoliciesResponse,
|
|
364
|
-
unmarshalListInstanceTemplatesResponse
|
|
365
|
-
};
|
|
280
|
+
export { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse };
|