@scaleway/sdk 2.5.0 → 2.6.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/instance/v1/api.gen.js +54 -15
- package/dist/api/instance/v1/api.utils.js +0 -126
- package/dist/api/instance/v1/marshalling.gen.js +76 -4
- package/dist/api/jobs/v1alpha1/api.gen.js +13 -26
- package/dist/api/k8s/v1/marshalling.gen.js +1 -0
- package/dist/index.cjs +142 -221
- package/dist/index.d.ts +141 -131
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/scw-error.js +0 -1
- package/package.json +2 -2
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
package/dist/index.cjs
CHANGED
|
@@ -497,7 +497,7 @@ const assertValidSettings = obj => {
|
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
|
|
500
|
-
const version = 'v2.
|
|
500
|
+
const version = 'v2.5.0';
|
|
501
501
|
const userAgent = `scaleway-sdk-js/${version}`;
|
|
502
502
|
|
|
503
503
|
const isBrowser = () =>
|
|
@@ -766,7 +766,6 @@ class ScalewayError extends Error {
|
|
|
766
766
|
this.rawMessage = typeof body === 'object' && typeof body.message === 'string' ? body.message : undefined;
|
|
767
767
|
Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain
|
|
768
768
|
}
|
|
769
|
-
|
|
770
769
|
static fromJSON(status, obj) {
|
|
771
770
|
return new ScalewayError(status, obj);
|
|
772
771
|
}
|
|
@@ -3988,7 +3987,7 @@ const marshalImportSnapshotFromS3Request = (request, defaults) => ({
|
|
|
3988
3987
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
3989
3988
|
tags: request.tags
|
|
3990
3989
|
});
|
|
3991
|
-
const marshalUpdateSnapshotRequest$
|
|
3990
|
+
const marshalUpdateSnapshotRequest$3 = (request, defaults) => ({
|
|
3992
3991
|
name: request.name,
|
|
3993
3992
|
tags: request.tags
|
|
3994
3993
|
});
|
|
@@ -4185,7 +4184,7 @@ let API$q = class API extends API$v {
|
|
|
4185
4184
|
* @returns A Promise of Snapshot
|
|
4186
4185
|
*/
|
|
4187
4186
|
updateSnapshot = request => this.client.fetch({
|
|
4188
|
-
body: JSON.stringify(marshalUpdateSnapshotRequest$
|
|
4187
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest$3(request, this.client.settings)),
|
|
4189
4188
|
headers: jsonContentHeaders$p,
|
|
4190
4189
|
method: 'PATCH',
|
|
4191
4190
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
@@ -6434,7 +6433,7 @@ const marshalUpdateInstanceRequest$1 = (request, defaults) => ({
|
|
|
6434
6433
|
name: request.name,
|
|
6435
6434
|
tags: request.tags
|
|
6436
6435
|
});
|
|
6437
|
-
const marshalUpdateSnapshotRequest$
|
|
6436
|
+
const marshalUpdateSnapshotRequest$2 = (request, defaults) => ({
|
|
6438
6437
|
expires_at: request.expiresAt,
|
|
6439
6438
|
name: request.name
|
|
6440
6439
|
});
|
|
@@ -7139,7 +7138,7 @@ let API$n = class API extends API$v {
|
|
|
7139
7138
|
* @returns A Promise of Snapshot
|
|
7140
7139
|
*/
|
|
7141
7140
|
updateSnapshot = request => this.client.fetch({
|
|
7142
|
-
body: JSON.stringify(marshalUpdateSnapshotRequest$
|
|
7141
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest$2(request, this.client.settings)),
|
|
7143
7142
|
headers: jsonContentHeaders$m,
|
|
7144
7143
|
method: 'PATCH',
|
|
7145
7144
|
path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
@@ -12757,6 +12756,14 @@ const unmarshalSetSnapshotResponse = data => {
|
|
|
12757
12756
|
snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined
|
|
12758
12757
|
};
|
|
12759
12758
|
};
|
|
12759
|
+
const unmarshalUpdateImageResponse = data => {
|
|
12760
|
+
if (!isJSONObject(data)) {
|
|
12761
|
+
throw new TypeError(`Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`);
|
|
12762
|
+
}
|
|
12763
|
+
return {
|
|
12764
|
+
image: data.image ? unmarshalImage$3(data.image) : undefined
|
|
12765
|
+
};
|
|
12766
|
+
};
|
|
12760
12767
|
const unmarshalUpdateIpResponse = data => {
|
|
12761
12768
|
if (!isJSONObject(data)) {
|
|
12762
12769
|
throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`);
|
|
@@ -12781,6 +12788,22 @@ const unmarshalUpdatePlacementGroupServersResponse = data => {
|
|
|
12781
12788
|
servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)
|
|
12782
12789
|
};
|
|
12783
12790
|
};
|
|
12791
|
+
const unmarshalUpdateSecurityGroupResponse = data => {
|
|
12792
|
+
if (!isJSONObject(data)) {
|
|
12793
|
+
throw new TypeError(`Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`);
|
|
12794
|
+
}
|
|
12795
|
+
return {
|
|
12796
|
+
securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined
|
|
12797
|
+
};
|
|
12798
|
+
};
|
|
12799
|
+
const unmarshalUpdateSecurityGroupRuleResponse = data => {
|
|
12800
|
+
if (!isJSONObject(data)) {
|
|
12801
|
+
throw new TypeError(`Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
|
|
12802
|
+
}
|
|
12803
|
+
return {
|
|
12804
|
+
rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined
|
|
12805
|
+
};
|
|
12806
|
+
};
|
|
12784
12807
|
const unmarshalUpdateServerResponse = data => {
|
|
12785
12808
|
if (!isJSONObject(data)) {
|
|
12786
12809
|
throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`);
|
|
@@ -12789,6 +12812,14 @@ const unmarshalUpdateServerResponse = data => {
|
|
|
12789
12812
|
server: data.server ? unmarshalServer(data.server) : undefined
|
|
12790
12813
|
};
|
|
12791
12814
|
};
|
|
12815
|
+
const unmarshalUpdateSnapshotResponse = data => {
|
|
12816
|
+
if (!isJSONObject(data)) {
|
|
12817
|
+
throw new TypeError(`Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`);
|
|
12818
|
+
}
|
|
12819
|
+
return {
|
|
12820
|
+
snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined
|
|
12821
|
+
};
|
|
12822
|
+
};
|
|
12792
12823
|
const unmarshalUpdateVolumeResponse = data => {
|
|
12793
12824
|
if (!isJSONObject(data)) {
|
|
12794
12825
|
throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`);
|
|
@@ -13019,11 +13050,11 @@ const marshalServerActionRequest = (request, defaults) => ({
|
|
|
13019
13050
|
[key]: marshalServerActionRequestVolumeBackupTemplate(value)
|
|
13020
13051
|
}), {}) : undefined
|
|
13021
13052
|
});
|
|
13022
|
-
const marshalServerSummary
|
|
13053
|
+
const marshalServerSummary = (request, defaults) => ({
|
|
13023
13054
|
id: request.id,
|
|
13024
13055
|
name: request.name
|
|
13025
13056
|
});
|
|
13026
|
-
const marshalBootscript
|
|
13057
|
+
const marshalBootscript = (request, defaults) => ({
|
|
13027
13058
|
arch: request.arch,
|
|
13028
13059
|
bootcmdargs: request.bootcmdargs,
|
|
13029
13060
|
default: request.default,
|
|
@@ -13037,7 +13068,7 @@ const marshalBootscript$1 = (request, defaults) => ({
|
|
|
13037
13068
|
title: request.title,
|
|
13038
13069
|
zone: request.zone
|
|
13039
13070
|
});
|
|
13040
|
-
const marshalVolume
|
|
13071
|
+
const marshalVolume = (request, defaults) => ({
|
|
13041
13072
|
creation_date: request.creationDate,
|
|
13042
13073
|
export_uri: request.exportUri,
|
|
13043
13074
|
id: request.id,
|
|
@@ -13045,14 +13076,14 @@ const marshalVolume$1 = (request, defaults) => ({
|
|
|
13045
13076
|
name: request.name,
|
|
13046
13077
|
organization: request.organization,
|
|
13047
13078
|
project: request.project,
|
|
13048
|
-
server: request.server !== undefined ? marshalServerSummary
|
|
13079
|
+
server: request.server !== undefined ? marshalServerSummary(request.server) : undefined,
|
|
13049
13080
|
size: request.size,
|
|
13050
13081
|
state: request.state,
|
|
13051
13082
|
tags: request.tags,
|
|
13052
13083
|
volume_type: request.volumeType,
|
|
13053
13084
|
zone: request.zone
|
|
13054
13085
|
});
|
|
13055
|
-
const marshalVolumeSummary
|
|
13086
|
+
const marshalVolumeSummary = (request, defaults) => ({
|
|
13056
13087
|
id: request.id,
|
|
13057
13088
|
name: request.name,
|
|
13058
13089
|
size: request.size,
|
|
@@ -13061,10 +13092,10 @@ const marshalVolumeSummary$1 = (request, defaults) => ({
|
|
|
13061
13092
|
const marshalSetImageRequest = (request, defaults) => ({
|
|
13062
13093
|
arch: request.arch,
|
|
13063
13094
|
creation_date: request.creationDate,
|
|
13064
|
-
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript
|
|
13095
|
+
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
13065
13096
|
extra_volumes: request.extraVolumes !== undefined ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
13066
13097
|
...acc,
|
|
13067
|
-
[key]: marshalVolume
|
|
13098
|
+
[key]: marshalVolume(value)
|
|
13068
13099
|
}), {}) : undefined,
|
|
13069
13100
|
from_server: request.fromServer,
|
|
13070
13101
|
modification_date: request.modificationDate,
|
|
@@ -13072,7 +13103,7 @@ const marshalSetImageRequest = (request, defaults) => ({
|
|
|
13072
13103
|
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
13073
13104
|
project: request.project ?? defaults.defaultProjectId,
|
|
13074
13105
|
public: request.public,
|
|
13075
|
-
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary
|
|
13106
|
+
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
13076
13107
|
state: request.state,
|
|
13077
13108
|
tags: request.tags
|
|
13078
13109
|
});
|
|
@@ -13099,7 +13130,7 @@ const marshalSetSecurityGroupRequest = (request, defaults) => ({
|
|
|
13099
13130
|
outbound_default_policy: request.outboundDefaultPolicy,
|
|
13100
13131
|
project: request.project ?? defaults.defaultProjectId,
|
|
13101
13132
|
project_default: request.projectDefault,
|
|
13102
|
-
servers: request.servers !== undefined ? request.servers.map(elt => marshalServerSummary
|
|
13133
|
+
servers: request.servers !== undefined ? request.servers.map(elt => marshalServerSummary(elt)) : undefined,
|
|
13103
13134
|
stateful: request.stateful,
|
|
13104
13135
|
tags: request.tags
|
|
13105
13136
|
});
|
|
@@ -13132,10 +13163,10 @@ const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({
|
|
|
13132
13163
|
const marshalImage = (request, defaults) => ({
|
|
13133
13164
|
arch: request.arch,
|
|
13134
13165
|
creation_date: request.creationDate,
|
|
13135
|
-
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript
|
|
13166
|
+
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
13136
13167
|
extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
13137
13168
|
...acc,
|
|
13138
|
-
[key]: marshalVolume
|
|
13169
|
+
[key]: marshalVolume(value)
|
|
13139
13170
|
}), {}),
|
|
13140
13171
|
from_server: request.fromServer,
|
|
13141
13172
|
id: request.id,
|
|
@@ -13144,7 +13175,7 @@ const marshalImage = (request, defaults) => ({
|
|
|
13144
13175
|
organization: request.organization,
|
|
13145
13176
|
project: request.project,
|
|
13146
13177
|
public: request.public,
|
|
13147
|
-
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary
|
|
13178
|
+
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
13148
13179
|
state: request.state,
|
|
13149
13180
|
tags: request.tags,
|
|
13150
13181
|
zone: request.zone
|
|
@@ -13202,7 +13233,7 @@ const marshalSetServerRequest = (request, defaults) => ({
|
|
|
13202
13233
|
allowed_actions: request.allowedActions !== undefined ? request.allowedActions : undefined,
|
|
13203
13234
|
arch: request.arch,
|
|
13204
13235
|
boot_type: request.bootType,
|
|
13205
|
-
bootscript: request.bootscript !== undefined ? marshalBootscript
|
|
13236
|
+
bootscript: request.bootscript !== undefined ? marshalBootscript(request.bootscript) : undefined,
|
|
13206
13237
|
commercial_type: request.commercialType,
|
|
13207
13238
|
creation_date: request.creationDate,
|
|
13208
13239
|
dynamic_ip_required: request.dynamicIpRequired,
|
|
@@ -13229,7 +13260,7 @@ const marshalSetServerRequest = (request, defaults) => ({
|
|
|
13229
13260
|
tags: request.tags,
|
|
13230
13261
|
volumes: request.volumes !== undefined ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
|
|
13231
13262
|
...acc,
|
|
13232
|
-
[key]: marshalVolume
|
|
13263
|
+
[key]: marshalVolume(value)
|
|
13233
13264
|
}), {}) : undefined
|
|
13234
13265
|
});
|
|
13235
13266
|
const marshalSnapshotBaseVolume = (request, defaults) => ({
|
|
@@ -13249,6 +13280,19 @@ const marshalSetSnapshotRequest = (request, defaults) => ({
|
|
|
13249
13280
|
tags: request.tags,
|
|
13250
13281
|
volume_type: request.volumeType
|
|
13251
13282
|
});
|
|
13283
|
+
const marshalVolumeImageUpdateTemplate = (request, defaults) => ({
|
|
13284
|
+
id: request.id
|
|
13285
|
+
});
|
|
13286
|
+
const marshalUpdateImageRequest$1 = (request, defaults) => ({
|
|
13287
|
+
arch: request.arch,
|
|
13288
|
+
extra_volumes: request.extraVolumes !== undefined ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
13289
|
+
...acc,
|
|
13290
|
+
[key]: marshalVolumeImageUpdateTemplate(value)
|
|
13291
|
+
}), {}) : undefined,
|
|
13292
|
+
name: request.name,
|
|
13293
|
+
public: request.public,
|
|
13294
|
+
tags: request.tags
|
|
13295
|
+
});
|
|
13252
13296
|
const marshalUpdateIpRequest$1 = (request, defaults) => ({
|
|
13253
13297
|
reverse: request.reverse,
|
|
13254
13298
|
server: request.server,
|
|
@@ -13267,6 +13311,26 @@ const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({
|
|
|
13267
13311
|
const marshalUpdatePrivateNICRequest = (request, defaults) => ({
|
|
13268
13312
|
tags: request.tags
|
|
13269
13313
|
});
|
|
13314
|
+
const marshalUpdateSecurityGroupRequest = (request, defaults) => ({
|
|
13315
|
+
description: request.description,
|
|
13316
|
+
enable_default_security: request.enableDefaultSecurity,
|
|
13317
|
+
inbound_default_policy: request.inboundDefaultPolicy,
|
|
13318
|
+
name: request.name,
|
|
13319
|
+
organization_default: request.organizationDefault,
|
|
13320
|
+
outbound_default_policy: request.outboundDefaultPolicy,
|
|
13321
|
+
project_default: request.projectDefault,
|
|
13322
|
+
stateful: request.stateful,
|
|
13323
|
+
tags: request.tags
|
|
13324
|
+
});
|
|
13325
|
+
const marshalUpdateSecurityGroupRuleRequest = (request, defaults) => ({
|
|
13326
|
+
action: request.action,
|
|
13327
|
+
dest_port_from: request.destPortFrom,
|
|
13328
|
+
dest_port_to: request.destPortTo,
|
|
13329
|
+
direction: request.direction,
|
|
13330
|
+
ip_range: request.ipRange,
|
|
13331
|
+
position: request.position,
|
|
13332
|
+
protocol: request.protocol
|
|
13333
|
+
});
|
|
13270
13334
|
const marshalSecurityGroupTemplate = (request, defaults) => ({
|
|
13271
13335
|
id: request.id,
|
|
13272
13336
|
name: request.name
|
|
@@ -13290,6 +13354,10 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
13290
13354
|
[key]: marshalVolumeServerTemplate(value)
|
|
13291
13355
|
}), {}) : undefined
|
|
13292
13356
|
});
|
|
13357
|
+
const marshalUpdateSnapshotRequest$1 = (request, defaults) => ({
|
|
13358
|
+
name: request.name,
|
|
13359
|
+
tags: request.tags
|
|
13360
|
+
});
|
|
13293
13361
|
const marshalUpdateVolumeRequest$1 = (request, defaults) => ({
|
|
13294
13362
|
name: request.name,
|
|
13295
13363
|
size: request.size,
|
|
@@ -13455,26 +13523,12 @@ let API$i = class API extends API$v {
|
|
|
13455
13523
|
method: 'DELETE',
|
|
13456
13524
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`
|
|
13457
13525
|
});
|
|
13458
|
-
|
|
13459
|
-
/**
|
|
13460
|
-
* Attach a volume to a server.
|
|
13461
|
-
*
|
|
13462
|
-
* @param request - The request {@link AttachServerVolumeRequest}
|
|
13463
|
-
* @returns A Promise of AttachServerVolumeResponse
|
|
13464
|
-
*/
|
|
13465
13526
|
attachServerVolume = request => this.client.fetch({
|
|
13466
13527
|
body: JSON.stringify(marshalAttachServerVolumeRequest(request, this.client.settings)),
|
|
13467
13528
|
headers: jsonContentHeaders$h,
|
|
13468
13529
|
method: 'POST',
|
|
13469
13530
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/attach-volume`
|
|
13470
13531
|
}, unmarshalAttachServerVolumeResponse);
|
|
13471
|
-
|
|
13472
|
-
/**
|
|
13473
|
-
* Detach a volume from a server.
|
|
13474
|
-
*
|
|
13475
|
-
* @param request - The request {@link DetachServerVolumeRequest}
|
|
13476
|
-
* @returns A Promise of DetachServerVolumeResponse
|
|
13477
|
-
*/
|
|
13478
13532
|
detachServerVolume = request => this.client.fetch({
|
|
13479
13533
|
body: JSON.stringify(marshalDetachServerVolumeRequest(request, this.client.settings)),
|
|
13480
13534
|
headers: jsonContentHeaders$h,
|
|
@@ -13526,6 +13580,19 @@ let API$i = class API extends API$v {
|
|
|
13526
13580
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('id', request.id)}`
|
|
13527
13581
|
}, unmarshalSetImageResponse);
|
|
13528
13582
|
|
|
13583
|
+
/**
|
|
13584
|
+
* Update image. Update the properties of an image.
|
|
13585
|
+
*
|
|
13586
|
+
* @param request - The request {@link UpdateImageRequest}
|
|
13587
|
+
* @returns A Promise of UpdateImageResponse
|
|
13588
|
+
*/
|
|
13589
|
+
updateImage = request => this.client.fetch({
|
|
13590
|
+
body: JSON.stringify(marshalUpdateImageRequest$1(request, this.client.settings)),
|
|
13591
|
+
headers: jsonContentHeaders$h,
|
|
13592
|
+
method: 'PATCH',
|
|
13593
|
+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`
|
|
13594
|
+
}, unmarshalUpdateImageResponse);
|
|
13595
|
+
|
|
13529
13596
|
/**
|
|
13530
13597
|
* Delete an Instance image. Delete the image with the specified ID.
|
|
13531
13598
|
*
|
|
@@ -13582,6 +13649,19 @@ let API$i = class API extends API$v {
|
|
|
13582
13649
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
13583
13650
|
}, unmarshalSetSnapshotResponse);
|
|
13584
13651
|
|
|
13652
|
+
/**
|
|
13653
|
+
* Update a snapshot. Update the properties of a snapshot.
|
|
13654
|
+
*
|
|
13655
|
+
* @param request - The request {@link UpdateSnapshotRequest}
|
|
13656
|
+
* @returns A Promise of UpdateSnapshotResponse
|
|
13657
|
+
*/
|
|
13658
|
+
updateSnapshot = request => this.client.fetch({
|
|
13659
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest$1(request, this.client.settings)),
|
|
13660
|
+
headers: jsonContentHeaders$h,
|
|
13661
|
+
method: 'PATCH',
|
|
13662
|
+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
13663
|
+
}, unmarshalUpdateSnapshotResponse);
|
|
13664
|
+
|
|
13585
13665
|
/**
|
|
13586
13666
|
* Delete a snapshot. Delete the snapshot with the specified ID.
|
|
13587
13667
|
*
|
|
@@ -13725,6 +13805,19 @@ let API$i = class API extends API$v {
|
|
|
13725
13805
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('id', request.id)}`
|
|
13726
13806
|
}, unmarshalSetSecurityGroupResponse);
|
|
13727
13807
|
|
|
13808
|
+
/**
|
|
13809
|
+
* Update a security group. Update the properties of security group.
|
|
13810
|
+
*
|
|
13811
|
+
* @param request - The request {@link UpdateSecurityGroupRequest}
|
|
13812
|
+
* @returns A Promise of UpdateSecurityGroupResponse
|
|
13813
|
+
*/
|
|
13814
|
+
updateSecurityGroup = request => this.client.fetch({
|
|
13815
|
+
body: JSON.stringify(marshalUpdateSecurityGroupRequest(request, this.client.settings)),
|
|
13816
|
+
headers: jsonContentHeaders$h,
|
|
13817
|
+
method: 'PATCH',
|
|
13818
|
+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`
|
|
13819
|
+
}, unmarshalUpdateSecurityGroupResponse);
|
|
13820
|
+
|
|
13728
13821
|
/**
|
|
13729
13822
|
* Get default rules. Lists the default rules applied to all the security
|
|
13730
13823
|
* groups.
|
|
@@ -13805,6 +13898,20 @@ let API$i = class API extends API$v {
|
|
|
13805
13898
|
method: 'PUT',
|
|
13806
13899
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`
|
|
13807
13900
|
}, unmarshalSetSecurityGroupRuleResponse);
|
|
13901
|
+
|
|
13902
|
+
/**
|
|
13903
|
+
* Update security group rule. Update the properties of a rule from a
|
|
13904
|
+
* specified security group.
|
|
13905
|
+
*
|
|
13906
|
+
* @param request - The request {@link UpdateSecurityGroupRuleRequest}
|
|
13907
|
+
* @returns A Promise of UpdateSecurityGroupRuleResponse
|
|
13908
|
+
*/
|
|
13909
|
+
updateSecurityGroupRule = request => this.client.fetch({
|
|
13910
|
+
body: JSON.stringify(marshalUpdateSecurityGroupRuleRequest(request, this.client.settings)),
|
|
13911
|
+
headers: jsonContentHeaders$h,
|
|
13912
|
+
method: 'PATCH',
|
|
13913
|
+
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`
|
|
13914
|
+
}, unmarshalUpdateSecurityGroupRuleResponse);
|
|
13808
13915
|
pageOfListPlacementGroups = (request = {}) => this.client.fetch({
|
|
13809
13916
|
method: 'GET',
|
|
13810
13917
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups`,
|
|
@@ -14144,65 +14251,6 @@ const VOLUME_SERVER_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing'
|
|
|
14144
14251
|
/** Lists transient statutes of the enum {@link VolumeState}. */
|
|
14145
14252
|
const VOLUME_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing'];
|
|
14146
14253
|
|
|
14147
|
-
const marshalVolumeSummary = (request, defaults) => ({
|
|
14148
|
-
id: request.id,
|
|
14149
|
-
name: request.name,
|
|
14150
|
-
size: request.size,
|
|
14151
|
-
volume_type: request.volumeType
|
|
14152
|
-
});
|
|
14153
|
-
const marshalServerSummary = (request, defaults) => ({
|
|
14154
|
-
id: request.id,
|
|
14155
|
-
name: request.name
|
|
14156
|
-
});
|
|
14157
|
-
const marshalBootscript = (request, defaults) => ({
|
|
14158
|
-
arch: request.arch,
|
|
14159
|
-
bootcmdargs: request.bootcmdargs,
|
|
14160
|
-
default: request.default,
|
|
14161
|
-
dtb: request.dtb,
|
|
14162
|
-
id: request.id,
|
|
14163
|
-
initrd: request.initrd,
|
|
14164
|
-
kernel: request.kernel,
|
|
14165
|
-
organization: request.organization,
|
|
14166
|
-
project: request.project,
|
|
14167
|
-
public: request.public,
|
|
14168
|
-
title: request.title,
|
|
14169
|
-
zone: request.zone
|
|
14170
|
-
});
|
|
14171
|
-
const marshalVolume = (request, defaults) => ({
|
|
14172
|
-
creation_date: request.creationDate,
|
|
14173
|
-
export_uri: request.exportUri,
|
|
14174
|
-
id: request.id,
|
|
14175
|
-
modification_date: request.modificationDate,
|
|
14176
|
-
name: request.name,
|
|
14177
|
-
organization: request.organization,
|
|
14178
|
-
project: request.project,
|
|
14179
|
-
server: request.server ? marshalServerSummary(request.server) : undefined,
|
|
14180
|
-
size: request.size,
|
|
14181
|
-
state: request.state,
|
|
14182
|
-
tags: request.tags,
|
|
14183
|
-
volume_type: request.volumeType,
|
|
14184
|
-
zone: request.zone
|
|
14185
|
-
});
|
|
14186
|
-
const marshalSetImageRequestWithID = (request, defaults) => ({
|
|
14187
|
-
arch: request.arch,
|
|
14188
|
-
creation_date: request.creationDate,
|
|
14189
|
-
default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
14190
|
-
extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
14191
|
-
...acc,
|
|
14192
|
-
[key]: marshalVolume(value)
|
|
14193
|
-
}), {}) : undefined,
|
|
14194
|
-
from_server: request.fromServer,
|
|
14195
|
-
modification_date: request.modificationDate,
|
|
14196
|
-
id: request.id,
|
|
14197
|
-
name: request.name,
|
|
14198
|
-
organization: request.organization,
|
|
14199
|
-
project: request.project,
|
|
14200
|
-
public: request.public,
|
|
14201
|
-
root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
14202
|
-
state: request.state,
|
|
14203
|
-
tags: request.tags
|
|
14204
|
-
});
|
|
14205
|
-
|
|
14206
14254
|
const validateNotUndefined = obj => {
|
|
14207
14255
|
if (obj === undefined) throw new TypeError(`object was found undefined`);
|
|
14208
14256
|
return obj;
|
|
@@ -14283,104 +14331,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14283
14331
|
};
|
|
14284
14332
|
}, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
|
|
14285
14333
|
|
|
14286
|
-
/**
|
|
14287
|
-
* Updates a snapshot.
|
|
14288
|
-
*
|
|
14289
|
-
* @param request - The request {@link UpdateSnapshotRequest}
|
|
14290
|
-
* @returns A Promise of UpdateSnapshotResponse
|
|
14291
|
-
*/
|
|
14292
|
-
updateSnapshot = request => this.getSnapshot(request).then(res => validateNotUndefined(res.snapshot)).then(snapshot => this._setSnapshot({
|
|
14293
|
-
...snapshot,
|
|
14294
|
-
name: request.name ?? snapshot.name,
|
|
14295
|
-
snapshotId: snapshot.id
|
|
14296
|
-
})).then(res => ({
|
|
14297
|
-
snapshot: res.snapshot
|
|
14298
|
-
}));
|
|
14299
|
-
|
|
14300
|
-
/**
|
|
14301
|
-
* Updates a security group.
|
|
14302
|
-
*
|
|
14303
|
-
* @param request - The request {@link UpdateSecurityGroupRequest}
|
|
14304
|
-
* @returns A Promise of UpdateSecurityGroupResponse
|
|
14305
|
-
*/
|
|
14306
|
-
updateSecurityGroup = request => this.getSecurityGroup({
|
|
14307
|
-
securityGroupId: request.securityGroupId,
|
|
14308
|
-
zone: request.zone
|
|
14309
|
-
}).then(res => validateNotUndefined(res.securityGroup)).then(securityGroup => this._setSecurityGroup({
|
|
14310
|
-
creationDate: securityGroup.creationDate,
|
|
14311
|
-
description: request.description ?? securityGroup.description,
|
|
14312
|
-
enableDefaultSecurity: request.enableDefaultSecurity ?? securityGroup.enableDefaultSecurity,
|
|
14313
|
-
id: securityGroup.id,
|
|
14314
|
-
inboundDefaultPolicy: request.inboundDefaultPolicy ?? securityGroup.inboundDefaultPolicy,
|
|
14315
|
-
modificationDate: securityGroup.modificationDate,
|
|
14316
|
-
name: request.name ?? securityGroup.name,
|
|
14317
|
-
organization: securityGroup.organization,
|
|
14318
|
-
organizationDefault: request.organizationDefault ?? securityGroup.organizationDefault,
|
|
14319
|
-
outboundDefaultPolicy: request.outboundDefaultPolicy ?? securityGroup.outboundDefaultPolicy,
|
|
14320
|
-
project: securityGroup.project,
|
|
14321
|
-
projectDefault: request.projectDefault ?? securityGroup.projectDefault,
|
|
14322
|
-
servers: securityGroup.servers,
|
|
14323
|
-
stateful: request.stateful ?? securityGroup.stateful,
|
|
14324
|
-
zone: request.zone
|
|
14325
|
-
})).then(res => ({
|
|
14326
|
-
securityGroup: res.securityGroup
|
|
14327
|
-
}));
|
|
14328
|
-
|
|
14329
|
-
/**
|
|
14330
|
-
* Updates a security group rule.
|
|
14331
|
-
*
|
|
14332
|
-
* @param request - The request {@link UpdateSecurityGroupRuleRequest}
|
|
14333
|
-
* @returns A Promise of UpdateSecurityGroupRuleResponse
|
|
14334
|
-
*/
|
|
14335
|
-
updateSecurityGroupRule = request => this.getSecurityGroupRule({
|
|
14336
|
-
securityGroupId: request.securityGroupId,
|
|
14337
|
-
securityGroupRuleId: request.securityGroupRuleId,
|
|
14338
|
-
zone: request.zone
|
|
14339
|
-
}).then(res => validateNotUndefined(res.rule)).then(rule => {
|
|
14340
|
-
let sReq = {
|
|
14341
|
-
action: request.action ?? rule.action,
|
|
14342
|
-
destPortFrom: rule.destPortFrom,
|
|
14343
|
-
destPortTo: rule.destPortTo,
|
|
14344
|
-
direction: request.direction ?? rule.direction,
|
|
14345
|
-
editable: rule.editable,
|
|
14346
|
-
id: request.securityGroupRuleId,
|
|
14347
|
-
ipRange: request.ipRange ?? rule.ipRange,
|
|
14348
|
-
position: request.position ?? rule.position,
|
|
14349
|
-
protocol: request.protocol ?? rule.protocol,
|
|
14350
|
-
securityGroupId: request.securityGroupId,
|
|
14351
|
-
securityGroupRuleId: request.securityGroupRuleId
|
|
14352
|
-
};
|
|
14353
|
-
if (request.destPortFrom) {
|
|
14354
|
-
sReq = {
|
|
14355
|
-
...sReq,
|
|
14356
|
-
destPortFrom: request.destPortFrom > 0 ? request.destPortFrom : undefined
|
|
14357
|
-
};
|
|
14358
|
-
}
|
|
14359
|
-
if (request.destPortTo) {
|
|
14360
|
-
sReq = {
|
|
14361
|
-
...sReq,
|
|
14362
|
-
destPortTo: request.destPortTo > 0 ? request.destPortTo : undefined
|
|
14363
|
-
};
|
|
14364
|
-
}
|
|
14365
|
-
if (sReq.destPortFrom && sReq.destPortTo && sReq.destPortFrom === sReq.destPortTo) {
|
|
14366
|
-
sReq = {
|
|
14367
|
-
...sReq,
|
|
14368
|
-
destPortTo: undefined
|
|
14369
|
-
};
|
|
14370
|
-
}
|
|
14371
|
-
// When we use ICMP protocol portFrom and portTo should be set to nil
|
|
14372
|
-
if (request.protocol === 'ICMP') {
|
|
14373
|
-
sReq = {
|
|
14374
|
-
...sReq,
|
|
14375
|
-
destPortFrom: undefined,
|
|
14376
|
-
destPortTo: undefined
|
|
14377
|
-
};
|
|
14378
|
-
}
|
|
14379
|
-
return this._setSecurityGroupRule(sReq);
|
|
14380
|
-
}).then(res => ({
|
|
14381
|
-
rule: res.rule
|
|
14382
|
-
}));
|
|
14383
|
-
|
|
14384
14334
|
/**
|
|
14385
14335
|
* Updates a server.
|
|
14386
14336
|
*
|
|
@@ -14461,7 +14411,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14461
14411
|
id: request.volumeId,
|
|
14462
14412
|
name: request.volumeId // name is ignored on this PATCH
|
|
14463
14413
|
};
|
|
14464
|
-
|
|
14465
14414
|
found = true;
|
|
14466
14415
|
break;
|
|
14467
14416
|
}
|
|
@@ -14513,31 +14462,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14513
14462
|
}).then(obj => obj);
|
|
14514
14463
|
};
|
|
14515
14464
|
|
|
14516
|
-
/**
|
|
14517
|
-
* Updates an image.
|
|
14518
|
-
*
|
|
14519
|
-
* @param request - The request {@link UpdateImageRequest}
|
|
14520
|
-
* @returns A Promise of UpdateImageResponse
|
|
14521
|
-
*/
|
|
14522
|
-
updateImage = request => this.getImage({
|
|
14523
|
-
zone: request.zone,
|
|
14524
|
-
imageId: request.imageId
|
|
14525
|
-
}).then(res => validateNotUndefined(res.image)).then(image => ({
|
|
14526
|
-
...image,
|
|
14527
|
-
name: request.name ?? image.name,
|
|
14528
|
-
tags: request.tags ?? image.tags,
|
|
14529
|
-
id: image.id
|
|
14530
|
-
})).then(imageReq => this.client.fetch({
|
|
14531
|
-
body: JSON.stringify(marshalSetImageRequestWithID(imageReq, this.client.settings)),
|
|
14532
|
-
headers: {
|
|
14533
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
14534
|
-
},
|
|
14535
|
-
method: 'PUT',
|
|
14536
|
-
path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone)}/images/${validatePathParam('id', imageReq.id)}`
|
|
14537
|
-
}, unmarshalSetImageResponse)).then(res => ({
|
|
14538
|
-
image: res.image
|
|
14539
|
-
}));
|
|
14540
|
-
|
|
14541
14465
|
/**
|
|
14542
14466
|
* Get the content of a user data on a server for the given key.
|
|
14543
14467
|
*
|
|
@@ -16303,10 +16227,6 @@ const jsonContentHeaders$d = {
|
|
|
16303
16227
|
let API$e = class API extends API$v {
|
|
16304
16228
|
/** Lists the available regions of the API. */
|
|
16305
16229
|
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
16306
|
-
getServiceInfo = (request = {}) => this.client.fetch({
|
|
16307
|
-
method: 'GET',
|
|
16308
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}`
|
|
16309
|
-
}, unmarshalServiceInfo);
|
|
16310
16230
|
createJobDefinition = request => this.client.fetch({
|
|
16311
16231
|
body: JSON.stringify(marshalCreateJobDefinitionRequest(request, this.client.settings)),
|
|
16312
16232
|
headers: jsonContentHeaders$d,
|
|
@@ -16621,6 +16541,7 @@ const unmarshalExternalNode = data => {
|
|
|
16621
16541
|
kubeToken: data.kube_token,
|
|
16622
16542
|
kubeletConfig: data.kubelet_config,
|
|
16623
16543
|
name: data.name,
|
|
16544
|
+
nodeLabels: data.node_labels,
|
|
16624
16545
|
poolVersion: data.pool_version,
|
|
16625
16546
|
runcVersion: data.runc_version
|
|
16626
16547
|
};
|