@scaleway/sdk 1.15.0 → 1.17.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/container/v1beta1/api.gen.js +99 -2
- package/dist/api/container/v1beta1/content.gen.js +4 -1
- package/dist/api/container/v1beta1/index.gen.js +1 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +107 -1
- package/dist/api/instance/v1/api.gen.js +2 -1
- package/dist/api/instance/v1/content.gen.js +4 -1
- package/dist/api/instance/v1/index.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +26 -3
- package/dist/api/lb/v1/api.gen.js +72 -49
- package/dist/api/lb/v1/marshalling.gen.js +0 -4
- package/dist/api/marketplace/v2/api.gen.js +1 -1
- package/dist/api/marketplace/v2/marshalling.gen.js +1 -0
- package/dist/api/rdb/v1/index.gen.js +2 -0
- package/dist/api/rdb/v1/marshalling.gen.js +2 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
- package/dist/api/redis/v1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1alpha1/api.gen.js +34 -5
- package/dist/api/secret/v1alpha1/marshalling.gen.js +13 -2
- package/dist/api/vpc/v1/api.gen.js +1 -1
- package/dist/api/vpc/v2/api.gen.js +16 -1
- package/dist/api/vpc/v2/marshalling.gen.js +1 -0
- package/dist/api/vpcgw/v1/api.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/content.gen.js +1 -1
- package/dist/index.cjs +315 -34
- package/dist/index.d.ts +504 -127
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -2,8 +2,8 @@ import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
|
2
2
|
import { API as API$1 } from '../../../scw/api.js';
|
|
3
3
|
import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { NAMESPACE_TRANSIENT_STATUSES, CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListContainersResponse, unmarshalContainer, marshalCreateContainerRequest, marshalUpdateContainerRequest, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse } from './marshalling.gen.js';
|
|
5
|
+
import { NAMESPACE_TRANSIENT_STATUSES, CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
+
import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListContainersResponse, unmarshalContainer, marshalCreateContainerRequest, marshalUpdateContainerRequest, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest } from './marshalling.gen.js';
|
|
7
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -447,6 +447,103 @@ class API extends API$1 {
|
|
|
447
447
|
method: 'DELETE',
|
|
448
448
|
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
|
|
449
449
|
}, unmarshalToken);
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Create a trigger. Create a new trigger for a specified container.
|
|
453
|
+
*
|
|
454
|
+
* @param request - The request {@link CreateTriggerRequest}
|
|
455
|
+
* @returns A Promise of Trigger
|
|
456
|
+
*/
|
|
457
|
+
createTrigger = request => this.client.fetch({
|
|
458
|
+
body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
|
|
459
|
+
headers: jsonContentHeaders,
|
|
460
|
+
method: 'POST',
|
|
461
|
+
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`
|
|
462
|
+
}, unmarshalTrigger);
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Get a trigger. Get a trigger with a specified ID.
|
|
466
|
+
*
|
|
467
|
+
* @param request - The request {@link GetTriggerRequest}
|
|
468
|
+
* @returns A Promise of Trigger
|
|
469
|
+
*/
|
|
470
|
+
getTrigger = request => this.client.fetch({
|
|
471
|
+
method: 'GET',
|
|
472
|
+
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
|
|
473
|
+
}, unmarshalTrigger);
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Waits for {@link Trigger} to be in a final state.
|
|
477
|
+
*
|
|
478
|
+
* @param request - The request {@link GetTriggerRequest}
|
|
479
|
+
* @param options - The waiting options
|
|
480
|
+
* @returns A Promise of Trigger
|
|
481
|
+
*/
|
|
482
|
+
waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
|
|
483
|
+
pageOfListTriggers = (() => {
|
|
484
|
+
var _this8 = this;
|
|
485
|
+
return function (request) {
|
|
486
|
+
if (request === void 0) {
|
|
487
|
+
request = {};
|
|
488
|
+
}
|
|
489
|
+
return _this8.client.fetch({
|
|
490
|
+
method: 'GET',
|
|
491
|
+
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? _this8.client.settings.defaultRegion)}/triggers`,
|
|
492
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this8.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
|
|
493
|
+
default: _this8.client.settings.defaultProjectId,
|
|
494
|
+
param: 'project_id',
|
|
495
|
+
value: request.projectId
|
|
496
|
+
}, {
|
|
497
|
+
param: 'container_id',
|
|
498
|
+
value: request.containerId
|
|
499
|
+
}, {
|
|
500
|
+
param: 'namespace_id',
|
|
501
|
+
value: request.namespaceId
|
|
502
|
+
}])))
|
|
503
|
+
}, unmarshalListTriggersResponse);
|
|
504
|
+
};
|
|
505
|
+
})();
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* List all triggers. List all triggers belonging to a specified Organization
|
|
509
|
+
* or Project.
|
|
510
|
+
*
|
|
511
|
+
* @param request - The request {@link ListTriggersRequest}
|
|
512
|
+
* @returns A Promise of ListTriggersResponse
|
|
513
|
+
*/
|
|
514
|
+
listTriggers = (() => {
|
|
515
|
+
var _this9 = this;
|
|
516
|
+
return function (request) {
|
|
517
|
+
if (request === void 0) {
|
|
518
|
+
request = {};
|
|
519
|
+
}
|
|
520
|
+
return enrichForPagination('triggers', _this9.pageOfListTriggers, request);
|
|
521
|
+
};
|
|
522
|
+
})();
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Update a trigger. Update a trigger with a specified ID.
|
|
526
|
+
*
|
|
527
|
+
* @param request - The request {@link UpdateTriggerRequest}
|
|
528
|
+
* @returns A Promise of Trigger
|
|
529
|
+
*/
|
|
530
|
+
updateTrigger = request => this.client.fetch({
|
|
531
|
+
body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
|
|
532
|
+
headers: jsonContentHeaders,
|
|
533
|
+
method: 'PATCH',
|
|
534
|
+
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
|
|
535
|
+
}, unmarshalTrigger);
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Delete a trigger. Delete a trigger with a specified ID.
|
|
539
|
+
*
|
|
540
|
+
* @param request - The request {@link DeleteTriggerRequest}
|
|
541
|
+
* @returns A Promise of Trigger
|
|
542
|
+
*/
|
|
543
|
+
deleteTrigger = request => this.client.fetch({
|
|
544
|
+
method: 'DELETE',
|
|
545
|
+
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
|
|
546
|
+
}, unmarshalTrigger);
|
|
450
547
|
}
|
|
451
548
|
|
|
452
549
|
export { API };
|
|
@@ -16,4 +16,7 @@ const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
|
|
|
16
16
|
/** Lists transient statutes of the enum {@link TokenStatus}. */
|
|
17
17
|
const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/** Lists transient statutes of the enum {@link TriggerStatus}. */
|
|
20
|
+
const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
|
|
21
|
+
|
|
22
|
+
export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { API } from './api.gen.js';
|
|
2
|
-
export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
2
|
+
export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
3
3
|
|
|
4
4
|
// This file was automatically generated. DO NOT EDIT.
|
|
5
5
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -13,6 +13,41 @@ const unmarshalSecretHashedValue = data => {
|
|
|
13
13
|
key: data.key
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
22
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
23
|
+
mnqProjectId: data.mnq_project_id,
|
|
24
|
+
mnqRegion: data.mnq_region,
|
|
25
|
+
subject: data.subject
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const unmarshalTriggerMnqSqsClientConfig = data => {
|
|
29
|
+
if (!isJSONObject(data)) {
|
|
30
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
34
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
35
|
+
mnqProjectId: data.mnq_project_id,
|
|
36
|
+
mnqRegion: data.mnq_region,
|
|
37
|
+
queue: data.queue
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const unmarshalTriggerSqsClientConfig = data => {
|
|
41
|
+
if (!isJSONObject(data)) {
|
|
42
|
+
throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
accessKey: data.access_key,
|
|
46
|
+
endpoint: data.endpoint,
|
|
47
|
+
queueUrl: data.queue_url,
|
|
48
|
+
secretKey: data.secret_key
|
|
49
|
+
};
|
|
50
|
+
};
|
|
16
51
|
const unmarshalContainer = data => {
|
|
17
52
|
if (!isJSONObject(data)) {
|
|
18
53
|
throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`);
|
|
@@ -114,6 +149,23 @@ const unmarshalToken = data => {
|
|
|
114
149
|
token: data.token
|
|
115
150
|
};
|
|
116
151
|
};
|
|
152
|
+
const unmarshalTrigger = data => {
|
|
153
|
+
if (!isJSONObject(data)) {
|
|
154
|
+
throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
containerId: data.container_id,
|
|
158
|
+
description: data.description,
|
|
159
|
+
errorMessage: data.error_message,
|
|
160
|
+
id: data.id,
|
|
161
|
+
inputType: data.input_type,
|
|
162
|
+
name: data.name,
|
|
163
|
+
scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,
|
|
164
|
+
scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,
|
|
165
|
+
sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,
|
|
166
|
+
status: data.status
|
|
167
|
+
};
|
|
168
|
+
};
|
|
117
169
|
const unmarshalListContainersResponse = data => {
|
|
118
170
|
if (!isJSONObject(data)) {
|
|
119
171
|
throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`);
|
|
@@ -168,10 +220,41 @@ const unmarshalListTokensResponse = data => {
|
|
|
168
220
|
totalCount: data.total_count
|
|
169
221
|
};
|
|
170
222
|
};
|
|
223
|
+
const unmarshalListTriggersResponse = data => {
|
|
224
|
+
if (!isJSONObject(data)) {
|
|
225
|
+
throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
totalCount: data.total_count,
|
|
229
|
+
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
233
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
234
|
+
mnq_project_id: request.mnqProjectId,
|
|
235
|
+
mnq_region: request.mnqRegion,
|
|
236
|
+
subject: request.subject
|
|
237
|
+
});
|
|
238
|
+
const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
239
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
240
|
+
mnq_project_id: request.mnqProjectId,
|
|
241
|
+
mnq_region: request.mnqRegion,
|
|
242
|
+
queue: request.queue
|
|
243
|
+
});
|
|
244
|
+
const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
245
|
+
access_key: request.accessKey,
|
|
246
|
+
endpoint: request.endpoint,
|
|
247
|
+
queue_url: request.queueUrl,
|
|
248
|
+
secret_key: request.secretKey
|
|
249
|
+
});
|
|
171
250
|
const marshalSecret = (request, defaults) => ({
|
|
172
251
|
key: request.key,
|
|
173
252
|
value: request.value
|
|
174
253
|
});
|
|
254
|
+
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
255
|
+
access_key: request.accessKey,
|
|
256
|
+
secret_key: request.secretKey
|
|
257
|
+
});
|
|
175
258
|
const marshalCreateContainerRequest = (request, defaults) => ({
|
|
176
259
|
cpu_limit: request.cpuLimit,
|
|
177
260
|
description: request.description,
|
|
@@ -218,6 +301,21 @@ const marshalCreateTokenRequest = (request, defaults) => ({
|
|
|
218
301
|
value: request.namespaceId
|
|
219
302
|
}])
|
|
220
303
|
});
|
|
304
|
+
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
305
|
+
container_id: request.containerId,
|
|
306
|
+
description: request.description,
|
|
307
|
+
name: request.name,
|
|
308
|
+
...resolveOneOf([{
|
|
309
|
+
param: 'scw_sqs_config',
|
|
310
|
+
value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
311
|
+
}, {
|
|
312
|
+
param: 'sqs_config',
|
|
313
|
+
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
314
|
+
}, {
|
|
315
|
+
param: 'scw_nats_config',
|
|
316
|
+
value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
317
|
+
}])
|
|
318
|
+
});
|
|
221
319
|
const marshalUpdateContainerRequest = (request, defaults) => ({
|
|
222
320
|
cpu_limit: request.cpuLimit,
|
|
223
321
|
description: request.description,
|
|
@@ -246,5 +344,13 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
246
344
|
environment_variables: request.environmentVariables,
|
|
247
345
|
secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
|
|
248
346
|
});
|
|
347
|
+
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
348
|
+
description: request.description,
|
|
349
|
+
name: request.name,
|
|
350
|
+
...resolveOneOf([{
|
|
351
|
+
param: 'sqs_config',
|
|
352
|
+
value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
353
|
+
}])
|
|
354
|
+
});
|
|
249
355
|
|
|
250
|
-
export { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalNamespace, unmarshalToken };
|
|
356
|
+
export { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger };
|
|
@@ -12,7 +12,7 @@ const jsonContentHeaders = {
|
|
|
12
12
|
/** Instance API. */
|
|
13
13
|
class API extends API$1 {
|
|
14
14
|
/** Lists the available zones of the API. */
|
|
15
|
-
static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
|
|
15
|
+
static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Get availability. Get availability for all Instance types.
|
|
@@ -163,6 +163,7 @@ class API extends API$1 {
|
|
|
163
163
|
* keep the slot on the hypervisor. `reboot`: Stop the instance and restart
|
|
164
164
|
* it. `backup`: Create an image with all the volumes of an Instance.
|
|
165
165
|
* `terminate`: Delete the Instance along with all attached volumes.
|
|
166
|
+
* `enable_routed_ip`: Migrate the Instance to the new network stack.
|
|
166
167
|
*
|
|
167
168
|
* Keep in mind that terminating an Instance will result in the deletion of
|
|
168
169
|
* all attached volumes, including local and block storage. If you want to
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
/** Lists transient statutes of the enum {@link ImageState}. */
|
|
5
5
|
const IMAGE_TRANSIENT_STATUSES = ['creating'];
|
|
6
6
|
|
|
7
|
+
/** Lists transient statutes of the enum {@link IpState}. */
|
|
8
|
+
const IP_TRANSIENT_STATUSES = ['pending'];
|
|
9
|
+
|
|
7
10
|
/** Lists transient statutes of the enum {@link PrivateNICState}. */
|
|
8
11
|
const PRIVATE_NIC_TRANSIENT_STATUSES = ['syncing'];
|
|
9
12
|
|
|
@@ -25,4 +28,4 @@ const VOLUME_SERVER_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing'
|
|
|
25
28
|
/** Lists transient statutes of the enum {@link VolumeState}. */
|
|
26
29
|
const VOLUME_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing'];
|
|
27
30
|
|
|
28
|
-
export { IMAGE_TRANSIENT_STATUSES, PRIVATE_NIC_TRANSIENT_STATUSES, SECURITY_GROUP_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, TASK_TRANSIENT_STATUSES, VOLUME_SERVER_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES };
|
|
31
|
+
export { IMAGE_TRANSIENT_STATUSES, IP_TRANSIENT_STATUSES, PRIVATE_NIC_TRANSIENT_STATUSES, SECURITY_GROUP_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, TASK_TRANSIENT_STATUSES, VOLUME_SERVER_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { InstanceV1UtilsAPI as API } from './api.utils.js';
|
|
2
|
-
export { IMAGE_TRANSIENT_STATUSES, PRIVATE_NIC_TRANSIENT_STATUSES, SECURITY_GROUP_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, TASK_TRANSIENT_STATUSES, VOLUME_SERVER_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from './content.gen.js';
|
|
2
|
+
export { IMAGE_TRANSIENT_STATUSES, IP_TRANSIENT_STATUSES, PRIVATE_NIC_TRANSIENT_STATUSES, SECURITY_GROUP_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, TASK_TRANSIENT_STATUSES, VOLUME_SERVER_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from './content.gen.js';
|
|
@@ -148,7 +148,11 @@ const unmarshalServerIp = data => {
|
|
|
148
148
|
return {
|
|
149
149
|
address: data.address,
|
|
150
150
|
dynamic: data.dynamic,
|
|
151
|
-
|
|
151
|
+
family: data.family,
|
|
152
|
+
gateway: data.gateway,
|
|
153
|
+
id: data.id,
|
|
154
|
+
netmask: data.netmask,
|
|
155
|
+
provisioningMode: data.provisioning_mode
|
|
152
156
|
};
|
|
153
157
|
};
|
|
154
158
|
const unmarshalServerIpv6 = data => {
|
|
@@ -293,10 +297,13 @@ const unmarshalIp = data => {
|
|
|
293
297
|
address: data.address,
|
|
294
298
|
id: data.id,
|
|
295
299
|
organization: data.organization,
|
|
300
|
+
prefix: data.prefix,
|
|
296
301
|
project: data.project,
|
|
297
302
|
reverse: data.reverse,
|
|
298
303
|
server: data.server ? unmarshalServerSummary(data.server) : undefined,
|
|
304
|
+
state: data.state,
|
|
299
305
|
tags: data.tags,
|
|
306
|
+
type: data.type,
|
|
300
307
|
zone: data.zone
|
|
301
308
|
};
|
|
302
309
|
};
|
|
@@ -369,6 +376,7 @@ const unmarshalServer = data => {
|
|
|
369
376
|
image: data.image ? unmarshalImage(data.image) : undefined,
|
|
370
377
|
ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : undefined,
|
|
371
378
|
location: data.location ? unmarshalServerLocation(data.location) : undefined,
|
|
379
|
+
macAddress: data.mac_address,
|
|
372
380
|
maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance),
|
|
373
381
|
modificationDate: unmarshalDate(data.modification_date),
|
|
374
382
|
name: data.name,
|
|
@@ -379,6 +387,8 @@ const unmarshalServer = data => {
|
|
|
379
387
|
project: data.project,
|
|
380
388
|
protected: data.protected,
|
|
381
389
|
publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined,
|
|
390
|
+
publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),
|
|
391
|
+
routedIpEnabled: data.routed_ip_enabled,
|
|
382
392
|
securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : undefined,
|
|
383
393
|
state: data.state,
|
|
384
394
|
stateDetail: data.state_detail,
|
|
@@ -969,7 +979,11 @@ const marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({
|
|
|
969
979
|
const marshalServerIp = (request, defaults) => ({
|
|
970
980
|
address: request.address,
|
|
971
981
|
dynamic: request.dynamic,
|
|
972
|
-
|
|
982
|
+
family: request.family,
|
|
983
|
+
gateway: request.gateway,
|
|
984
|
+
id: request.id,
|
|
985
|
+
netmask: request.netmask,
|
|
986
|
+
provisioning_mode: request.provisioningMode
|
|
973
987
|
});
|
|
974
988
|
const marshalServerIpv6 = (request, defaults) => ({
|
|
975
989
|
address: request.address,
|
|
@@ -1052,6 +1066,7 @@ const marshalCreateImageRequest = (request, defaults) => ({
|
|
|
1052
1066
|
const marshalCreateIpRequest = (request, defaults) => ({
|
|
1053
1067
|
server: request.server,
|
|
1054
1068
|
tags: request.tags,
|
|
1069
|
+
type: request.type ?? 'unknown_iptype',
|
|
1055
1070
|
...resolveOneOf([{
|
|
1056
1071
|
default: defaults.defaultProjectId,
|
|
1057
1072
|
param: 'project',
|
|
@@ -1078,6 +1093,7 @@ const marshalCreatePlacementGroupRequest = (request, defaults) => ({
|
|
|
1078
1093
|
}])
|
|
1079
1094
|
});
|
|
1080
1095
|
const marshalCreatePrivateNICRequest = (request, defaults) => ({
|
|
1096
|
+
ip_ids: request.ipIds,
|
|
1081
1097
|
private_network_id: request.privateNetworkId,
|
|
1082
1098
|
tags: request.tags
|
|
1083
1099
|
});
|
|
@@ -1126,6 +1142,8 @@ const marshalCreateServerRequest = (request, defaults) => ({
|
|
|
1126
1142
|
name: request.name || randomName('srv'),
|
|
1127
1143
|
placement_group: request.placementGroup,
|
|
1128
1144
|
public_ip: request.publicIp,
|
|
1145
|
+
public_ips: request.publicIps,
|
|
1146
|
+
routed_ip_enabled: request.routedIpEnabled,
|
|
1129
1147
|
security_group: request.securityGroup,
|
|
1130
1148
|
tags: request.tags,
|
|
1131
1149
|
volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, _ref3) => {
|
|
@@ -1287,6 +1305,8 @@ const marshalSetServerRequest = (request, defaults) => ({
|
|
|
1287
1305
|
project: request.project,
|
|
1288
1306
|
protected: request.protected,
|
|
1289
1307
|
public_ip: request.publicIp ? marshalServerIp(request.publicIp) : undefined,
|
|
1308
|
+
public_ips: request.publicIps ? request.publicIps.map(elt => marshalServerIp(elt)) : undefined,
|
|
1309
|
+
routed_ip_enabled: request.routedIpEnabled,
|
|
1290
1310
|
security_group: request.securityGroup ? marshalSecurityGroupSummary(request.securityGroup) : undefined,
|
|
1291
1311
|
state: request.state,
|
|
1292
1312
|
state_detail: request.stateDetail,
|
|
@@ -1315,7 +1335,8 @@ const marshalSetSnapshotRequest = (request, defaults) => ({
|
|
|
1315
1335
|
const marshalUpdateIpRequest = (request, defaults) => ({
|
|
1316
1336
|
reverse: request.reverse,
|
|
1317
1337
|
server: request.server,
|
|
1318
|
-
tags: request.tags
|
|
1338
|
+
tags: request.tags,
|
|
1339
|
+
type: request.type ?? 'unknown_iptype'
|
|
1319
1340
|
});
|
|
1320
1341
|
const marshalUpdatePlacementGroupRequest = (request, defaults) => ({
|
|
1321
1342
|
name: request.name,
|
|
@@ -1338,6 +1359,8 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
1338
1359
|
placement_group: request.placementGroup,
|
|
1339
1360
|
private_nics: request.privateNics ? request.privateNics.map(elt => marshalPrivateNIC(elt)) : undefined,
|
|
1340
1361
|
protected: request.protected,
|
|
1362
|
+
public_ips: request.publicIps ? request.publicIps.map(elt => marshalServerIp(elt)) : undefined,
|
|
1363
|
+
routed_ip_enabled: request.routedIpEnabled,
|
|
1341
1364
|
security_group: request.securityGroup ? marshalSecurityGroupTemplate(request.securityGroup) : undefined,
|
|
1342
1365
|
tags: request.tags,
|
|
1343
1366
|
volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, _ref7) => {
|