@scaleway/sdk 2.4.2 → 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/cockpit/v1beta1/api.gen.js +10 -0
- package/dist/api/iam/v1alpha1/api.gen.js +19 -1
- 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 +5 -1
- package/dist/api/webhosting/v1alpha1/api.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +3 -0
- package/dist/index.cjs +179 -224
- package/dist/index.d.ts +192 -143
- 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)}`
|
|
@@ -4628,6 +4627,16 @@ let API$p = class API extends API$v {
|
|
|
4628
4627
|
method: 'POST',
|
|
4629
4628
|
path: `/cockpit/v1beta1/datasources`
|
|
4630
4629
|
}, unmarshalDatasource);
|
|
4630
|
+
|
|
4631
|
+
/**
|
|
4632
|
+
* Delete the datasource associated with the specified datasource ID.
|
|
4633
|
+
*
|
|
4634
|
+
* @param request - The request {@link DeleteDatasourceRequest}
|
|
4635
|
+
*/
|
|
4636
|
+
deleteDatasource = request => this.client.fetch({
|
|
4637
|
+
method: 'DELETE',
|
|
4638
|
+
path: `/cockpit/v1beta1/datasources/${validatePathParam('datasourceId', request.datasourceId)}`
|
|
4639
|
+
});
|
|
4631
4640
|
pageOfListDatasources = (request = {}) => this.client.fetch({
|
|
4632
4641
|
method: 'GET',
|
|
4633
4642
|
path: `/cockpit/v1beta1/datasources`,
|
|
@@ -6424,7 +6433,7 @@ const marshalUpdateInstanceRequest$1 = (request, defaults) => ({
|
|
|
6424
6433
|
name: request.name,
|
|
6425
6434
|
tags: request.tags
|
|
6426
6435
|
});
|
|
6427
|
-
const marshalUpdateSnapshotRequest$
|
|
6436
|
+
const marshalUpdateSnapshotRequest$2 = (request, defaults) => ({
|
|
6428
6437
|
expires_at: request.expiresAt,
|
|
6429
6438
|
name: request.name
|
|
6430
6439
|
});
|
|
@@ -7129,7 +7138,7 @@ let API$n = class API extends API$v {
|
|
|
7129
7138
|
* @returns A Promise of Snapshot
|
|
7130
7139
|
*/
|
|
7131
7140
|
updateSnapshot = request => this.client.fetch({
|
|
7132
|
-
body: JSON.stringify(marshalUpdateSnapshotRequest$
|
|
7141
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest$2(request, this.client.settings)),
|
|
7133
7142
|
headers: jsonContentHeaders$m,
|
|
7134
7143
|
method: 'PATCH',
|
|
7135
7144
|
path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
@@ -11546,7 +11555,7 @@ let API$j = class API extends API$v {
|
|
|
11546
11555
|
|
|
11547
11556
|
/**
|
|
11548
11557
|
* Get a quota in the Organization. Retrieve information about a resource
|
|
11549
|
-
* quota,
|
|
11558
|
+
* quota, specified by the `quotum_name` parameter. The quota's `limit`, or
|
|
11550
11559
|
* whether it is unlimited, is returned in the response.
|
|
11551
11560
|
*
|
|
11552
11561
|
* @param request - The request {@link GetQuotumRequest}
|
|
@@ -11596,7 +11605,25 @@ let API$j = class API extends API$v {
|
|
|
11596
11605
|
path: `/iam/v1alpha1/logs`,
|
|
11597
11606
|
urlParams: urlParams(['action', request.action], ['created_after', request.createdAfter], ['created_before', request.createdBefore], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['resource_type', request.resourceType], ['search', request.search])
|
|
11598
11607
|
}, unmarshalListLogsResponse);
|
|
11608
|
+
|
|
11609
|
+
/**
|
|
11610
|
+
* List logs. List logs available for given Organization. You must define the
|
|
11611
|
+
* `organization_id` in the query path of your request.
|
|
11612
|
+
*
|
|
11613
|
+
* @param request - The request {@link ListLogsRequest}
|
|
11614
|
+
* @returns A Promise of ListLogsResponse
|
|
11615
|
+
*/
|
|
11599
11616
|
listLogs = (request = {}) => enrichForPagination('logs', this.pageOfListLogs, request);
|
|
11617
|
+
|
|
11618
|
+
/**
|
|
11619
|
+
* Get a log. Retrieve information about a log, specified by the `log_id`
|
|
11620
|
+
* parameter. The log's full details, including `id`, `ip`, `user_agent`,
|
|
11621
|
+
* `action`, `bearer_id`, `resource_type` and `resource_id` are returned in
|
|
11622
|
+
* the response.
|
|
11623
|
+
*
|
|
11624
|
+
* @param request - The request {@link GetLogRequest}
|
|
11625
|
+
* @returns A Promise of Log
|
|
11626
|
+
*/
|
|
11600
11627
|
getLog = request => this.client.fetch({
|
|
11601
11628
|
method: 'GET',
|
|
11602
11629
|
path: `/iam/v1alpha1/logs/${validatePathParam('logId', request.logId)}`
|
|
@@ -12729,6 +12756,14 @@ const unmarshalSetSnapshotResponse = data => {
|
|
|
12729
12756
|
snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined
|
|
12730
12757
|
};
|
|
12731
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
|
+
};
|
|
12732
12767
|
const unmarshalUpdateIpResponse = data => {
|
|
12733
12768
|
if (!isJSONObject(data)) {
|
|
12734
12769
|
throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`);
|
|
@@ -12753,6 +12788,22 @@ const unmarshalUpdatePlacementGroupServersResponse = data => {
|
|
|
12753
12788
|
servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)
|
|
12754
12789
|
};
|
|
12755
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
|
+
};
|
|
12756
12807
|
const unmarshalUpdateServerResponse = data => {
|
|
12757
12808
|
if (!isJSONObject(data)) {
|
|
12758
12809
|
throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`);
|
|
@@ -12761,6 +12812,14 @@ const unmarshalUpdateServerResponse = data => {
|
|
|
12761
12812
|
server: data.server ? unmarshalServer(data.server) : undefined
|
|
12762
12813
|
};
|
|
12763
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
|
+
};
|
|
12764
12823
|
const unmarshalUpdateVolumeResponse = data => {
|
|
12765
12824
|
if (!isJSONObject(data)) {
|
|
12766
12825
|
throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`);
|
|
@@ -12991,11 +13050,11 @@ const marshalServerActionRequest = (request, defaults) => ({
|
|
|
12991
13050
|
[key]: marshalServerActionRequestVolumeBackupTemplate(value)
|
|
12992
13051
|
}), {}) : undefined
|
|
12993
13052
|
});
|
|
12994
|
-
const marshalServerSummary
|
|
13053
|
+
const marshalServerSummary = (request, defaults) => ({
|
|
12995
13054
|
id: request.id,
|
|
12996
13055
|
name: request.name
|
|
12997
13056
|
});
|
|
12998
|
-
const marshalBootscript
|
|
13057
|
+
const marshalBootscript = (request, defaults) => ({
|
|
12999
13058
|
arch: request.arch,
|
|
13000
13059
|
bootcmdargs: request.bootcmdargs,
|
|
13001
13060
|
default: request.default,
|
|
@@ -13009,7 +13068,7 @@ const marshalBootscript$1 = (request, defaults) => ({
|
|
|
13009
13068
|
title: request.title,
|
|
13010
13069
|
zone: request.zone
|
|
13011
13070
|
});
|
|
13012
|
-
const marshalVolume
|
|
13071
|
+
const marshalVolume = (request, defaults) => ({
|
|
13013
13072
|
creation_date: request.creationDate,
|
|
13014
13073
|
export_uri: request.exportUri,
|
|
13015
13074
|
id: request.id,
|
|
@@ -13017,14 +13076,14 @@ const marshalVolume$1 = (request, defaults) => ({
|
|
|
13017
13076
|
name: request.name,
|
|
13018
13077
|
organization: request.organization,
|
|
13019
13078
|
project: request.project,
|
|
13020
|
-
server: request.server !== undefined ? marshalServerSummary
|
|
13079
|
+
server: request.server !== undefined ? marshalServerSummary(request.server) : undefined,
|
|
13021
13080
|
size: request.size,
|
|
13022
13081
|
state: request.state,
|
|
13023
13082
|
tags: request.tags,
|
|
13024
13083
|
volume_type: request.volumeType,
|
|
13025
13084
|
zone: request.zone
|
|
13026
13085
|
});
|
|
13027
|
-
const marshalVolumeSummary
|
|
13086
|
+
const marshalVolumeSummary = (request, defaults) => ({
|
|
13028
13087
|
id: request.id,
|
|
13029
13088
|
name: request.name,
|
|
13030
13089
|
size: request.size,
|
|
@@ -13033,10 +13092,10 @@ const marshalVolumeSummary$1 = (request, defaults) => ({
|
|
|
13033
13092
|
const marshalSetImageRequest = (request, defaults) => ({
|
|
13034
13093
|
arch: request.arch,
|
|
13035
13094
|
creation_date: request.creationDate,
|
|
13036
|
-
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript
|
|
13095
|
+
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
13037
13096
|
extra_volumes: request.extraVolumes !== undefined ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
13038
13097
|
...acc,
|
|
13039
|
-
[key]: marshalVolume
|
|
13098
|
+
[key]: marshalVolume(value)
|
|
13040
13099
|
}), {}) : undefined,
|
|
13041
13100
|
from_server: request.fromServer,
|
|
13042
13101
|
modification_date: request.modificationDate,
|
|
@@ -13044,7 +13103,7 @@ const marshalSetImageRequest = (request, defaults) => ({
|
|
|
13044
13103
|
organization: request.organization ?? defaults.defaultOrganizationId,
|
|
13045
13104
|
project: request.project ?? defaults.defaultProjectId,
|
|
13046
13105
|
public: request.public,
|
|
13047
|
-
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary
|
|
13106
|
+
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
13048
13107
|
state: request.state,
|
|
13049
13108
|
tags: request.tags
|
|
13050
13109
|
});
|
|
@@ -13071,7 +13130,7 @@ const marshalSetSecurityGroupRequest = (request, defaults) => ({
|
|
|
13071
13130
|
outbound_default_policy: request.outboundDefaultPolicy,
|
|
13072
13131
|
project: request.project ?? defaults.defaultProjectId,
|
|
13073
13132
|
project_default: request.projectDefault,
|
|
13074
|
-
servers: request.servers !== undefined ? request.servers.map(elt => marshalServerSummary
|
|
13133
|
+
servers: request.servers !== undefined ? request.servers.map(elt => marshalServerSummary(elt)) : undefined,
|
|
13075
13134
|
stateful: request.stateful,
|
|
13076
13135
|
tags: request.tags
|
|
13077
13136
|
});
|
|
@@ -13104,10 +13163,10 @@ const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({
|
|
|
13104
13163
|
const marshalImage = (request, defaults) => ({
|
|
13105
13164
|
arch: request.arch,
|
|
13106
13165
|
creation_date: request.creationDate,
|
|
13107
|
-
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript
|
|
13166
|
+
default_bootscript: request.defaultBootscript !== undefined ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
13108
13167
|
extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
13109
13168
|
...acc,
|
|
13110
|
-
[key]: marshalVolume
|
|
13169
|
+
[key]: marshalVolume(value)
|
|
13111
13170
|
}), {}),
|
|
13112
13171
|
from_server: request.fromServer,
|
|
13113
13172
|
id: request.id,
|
|
@@ -13116,7 +13175,7 @@ const marshalImage = (request, defaults) => ({
|
|
|
13116
13175
|
organization: request.organization,
|
|
13117
13176
|
project: request.project,
|
|
13118
13177
|
public: request.public,
|
|
13119
|
-
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary
|
|
13178
|
+
root_volume: request.rootVolume !== undefined ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
13120
13179
|
state: request.state,
|
|
13121
13180
|
tags: request.tags,
|
|
13122
13181
|
zone: request.zone
|
|
@@ -13174,7 +13233,7 @@ const marshalSetServerRequest = (request, defaults) => ({
|
|
|
13174
13233
|
allowed_actions: request.allowedActions !== undefined ? request.allowedActions : undefined,
|
|
13175
13234
|
arch: request.arch,
|
|
13176
13235
|
boot_type: request.bootType,
|
|
13177
|
-
bootscript: request.bootscript !== undefined ? marshalBootscript
|
|
13236
|
+
bootscript: request.bootscript !== undefined ? marshalBootscript(request.bootscript) : undefined,
|
|
13178
13237
|
commercial_type: request.commercialType,
|
|
13179
13238
|
creation_date: request.creationDate,
|
|
13180
13239
|
dynamic_ip_required: request.dynamicIpRequired,
|
|
@@ -13201,7 +13260,7 @@ const marshalSetServerRequest = (request, defaults) => ({
|
|
|
13201
13260
|
tags: request.tags,
|
|
13202
13261
|
volumes: request.volumes !== undefined ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
|
|
13203
13262
|
...acc,
|
|
13204
|
-
[key]: marshalVolume
|
|
13263
|
+
[key]: marshalVolume(value)
|
|
13205
13264
|
}), {}) : undefined
|
|
13206
13265
|
});
|
|
13207
13266
|
const marshalSnapshotBaseVolume = (request, defaults) => ({
|
|
@@ -13221,6 +13280,19 @@ const marshalSetSnapshotRequest = (request, defaults) => ({
|
|
|
13221
13280
|
tags: request.tags,
|
|
13222
13281
|
volume_type: request.volumeType
|
|
13223
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
|
+
});
|
|
13224
13296
|
const marshalUpdateIpRequest$1 = (request, defaults) => ({
|
|
13225
13297
|
reverse: request.reverse,
|
|
13226
13298
|
server: request.server,
|
|
@@ -13239,6 +13311,26 @@ const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({
|
|
|
13239
13311
|
const marshalUpdatePrivateNICRequest = (request, defaults) => ({
|
|
13240
13312
|
tags: request.tags
|
|
13241
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
|
+
});
|
|
13242
13334
|
const marshalSecurityGroupTemplate = (request, defaults) => ({
|
|
13243
13335
|
id: request.id,
|
|
13244
13336
|
name: request.name
|
|
@@ -13262,6 +13354,10 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
13262
13354
|
[key]: marshalVolumeServerTemplate(value)
|
|
13263
13355
|
}), {}) : undefined
|
|
13264
13356
|
});
|
|
13357
|
+
const marshalUpdateSnapshotRequest$1 = (request, defaults) => ({
|
|
13358
|
+
name: request.name,
|
|
13359
|
+
tags: request.tags
|
|
13360
|
+
});
|
|
13265
13361
|
const marshalUpdateVolumeRequest$1 = (request, defaults) => ({
|
|
13266
13362
|
name: request.name,
|
|
13267
13363
|
size: request.size,
|
|
@@ -13427,26 +13523,12 @@ let API$i = class API extends API$v {
|
|
|
13427
13523
|
method: 'DELETE',
|
|
13428
13524
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`
|
|
13429
13525
|
});
|
|
13430
|
-
|
|
13431
|
-
/**
|
|
13432
|
-
* Attach a volume to a server.
|
|
13433
|
-
*
|
|
13434
|
-
* @param request - The request {@link AttachServerVolumeRequest}
|
|
13435
|
-
* @returns A Promise of AttachServerVolumeResponse
|
|
13436
|
-
*/
|
|
13437
13526
|
attachServerVolume = request => this.client.fetch({
|
|
13438
13527
|
body: JSON.stringify(marshalAttachServerVolumeRequest(request, this.client.settings)),
|
|
13439
13528
|
headers: jsonContentHeaders$h,
|
|
13440
13529
|
method: 'POST',
|
|
13441
13530
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/attach-volume`
|
|
13442
13531
|
}, unmarshalAttachServerVolumeResponse);
|
|
13443
|
-
|
|
13444
|
-
/**
|
|
13445
|
-
* Detach a volume from a server.
|
|
13446
|
-
*
|
|
13447
|
-
* @param request - The request {@link DetachServerVolumeRequest}
|
|
13448
|
-
* @returns A Promise of DetachServerVolumeResponse
|
|
13449
|
-
*/
|
|
13450
13532
|
detachServerVolume = request => this.client.fetch({
|
|
13451
13533
|
body: JSON.stringify(marshalDetachServerVolumeRequest(request, this.client.settings)),
|
|
13452
13534
|
headers: jsonContentHeaders$h,
|
|
@@ -13498,6 +13580,19 @@ let API$i = class API extends API$v {
|
|
|
13498
13580
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('id', request.id)}`
|
|
13499
13581
|
}, unmarshalSetImageResponse);
|
|
13500
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
|
+
|
|
13501
13596
|
/**
|
|
13502
13597
|
* Delete an Instance image. Delete the image with the specified ID.
|
|
13503
13598
|
*
|
|
@@ -13554,6 +13649,19 @@ let API$i = class API extends API$v {
|
|
|
13554
13649
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
|
|
13555
13650
|
}, unmarshalSetSnapshotResponse);
|
|
13556
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
|
+
|
|
13557
13665
|
/**
|
|
13558
13666
|
* Delete a snapshot. Delete the snapshot with the specified ID.
|
|
13559
13667
|
*
|
|
@@ -13697,6 +13805,19 @@ let API$i = class API extends API$v {
|
|
|
13697
13805
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('id', request.id)}`
|
|
13698
13806
|
}, unmarshalSetSecurityGroupResponse);
|
|
13699
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
|
+
|
|
13700
13821
|
/**
|
|
13701
13822
|
* Get default rules. Lists the default rules applied to all the security
|
|
13702
13823
|
* groups.
|
|
@@ -13777,6 +13898,20 @@ let API$i = class API extends API$v {
|
|
|
13777
13898
|
method: 'PUT',
|
|
13778
13899
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`
|
|
13779
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);
|
|
13780
13915
|
pageOfListPlacementGroups = (request = {}) => this.client.fetch({
|
|
13781
13916
|
method: 'GET',
|
|
13782
13917
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups`,
|
|
@@ -14116,65 +14251,6 @@ const VOLUME_SERVER_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing'
|
|
|
14116
14251
|
/** Lists transient statutes of the enum {@link VolumeState}. */
|
|
14117
14252
|
const VOLUME_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing'];
|
|
14118
14253
|
|
|
14119
|
-
const marshalVolumeSummary = (request, defaults) => ({
|
|
14120
|
-
id: request.id,
|
|
14121
|
-
name: request.name,
|
|
14122
|
-
size: request.size,
|
|
14123
|
-
volume_type: request.volumeType
|
|
14124
|
-
});
|
|
14125
|
-
const marshalServerSummary = (request, defaults) => ({
|
|
14126
|
-
id: request.id,
|
|
14127
|
-
name: request.name
|
|
14128
|
-
});
|
|
14129
|
-
const marshalBootscript = (request, defaults) => ({
|
|
14130
|
-
arch: request.arch,
|
|
14131
|
-
bootcmdargs: request.bootcmdargs,
|
|
14132
|
-
default: request.default,
|
|
14133
|
-
dtb: request.dtb,
|
|
14134
|
-
id: request.id,
|
|
14135
|
-
initrd: request.initrd,
|
|
14136
|
-
kernel: request.kernel,
|
|
14137
|
-
organization: request.organization,
|
|
14138
|
-
project: request.project,
|
|
14139
|
-
public: request.public,
|
|
14140
|
-
title: request.title,
|
|
14141
|
-
zone: request.zone
|
|
14142
|
-
});
|
|
14143
|
-
const marshalVolume = (request, defaults) => ({
|
|
14144
|
-
creation_date: request.creationDate,
|
|
14145
|
-
export_uri: request.exportUri,
|
|
14146
|
-
id: request.id,
|
|
14147
|
-
modification_date: request.modificationDate,
|
|
14148
|
-
name: request.name,
|
|
14149
|
-
organization: request.organization,
|
|
14150
|
-
project: request.project,
|
|
14151
|
-
server: request.server ? marshalServerSummary(request.server) : undefined,
|
|
14152
|
-
size: request.size,
|
|
14153
|
-
state: request.state,
|
|
14154
|
-
tags: request.tags,
|
|
14155
|
-
volume_type: request.volumeType,
|
|
14156
|
-
zone: request.zone
|
|
14157
|
-
});
|
|
14158
|
-
const marshalSetImageRequestWithID = (request, defaults) => ({
|
|
14159
|
-
arch: request.arch,
|
|
14160
|
-
creation_date: request.creationDate,
|
|
14161
|
-
default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
14162
|
-
extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({
|
|
14163
|
-
...acc,
|
|
14164
|
-
[key]: marshalVolume(value)
|
|
14165
|
-
}), {}) : undefined,
|
|
14166
|
-
from_server: request.fromServer,
|
|
14167
|
-
modification_date: request.modificationDate,
|
|
14168
|
-
id: request.id,
|
|
14169
|
-
name: request.name,
|
|
14170
|
-
organization: request.organization,
|
|
14171
|
-
project: request.project,
|
|
14172
|
-
public: request.public,
|
|
14173
|
-
root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
14174
|
-
state: request.state,
|
|
14175
|
-
tags: request.tags
|
|
14176
|
-
});
|
|
14177
|
-
|
|
14178
14254
|
const validateNotUndefined = obj => {
|
|
14179
14255
|
if (obj === undefined) throw new TypeError(`object was found undefined`);
|
|
14180
14256
|
return obj;
|
|
@@ -14255,104 +14331,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14255
14331
|
};
|
|
14256
14332
|
}, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
|
|
14257
14333
|
|
|
14258
|
-
/**
|
|
14259
|
-
* Updates a snapshot.
|
|
14260
|
-
*
|
|
14261
|
-
* @param request - The request {@link UpdateSnapshotRequest}
|
|
14262
|
-
* @returns A Promise of UpdateSnapshotResponse
|
|
14263
|
-
*/
|
|
14264
|
-
updateSnapshot = request => this.getSnapshot(request).then(res => validateNotUndefined(res.snapshot)).then(snapshot => this._setSnapshot({
|
|
14265
|
-
...snapshot,
|
|
14266
|
-
name: request.name ?? snapshot.name,
|
|
14267
|
-
snapshotId: snapshot.id
|
|
14268
|
-
})).then(res => ({
|
|
14269
|
-
snapshot: res.snapshot
|
|
14270
|
-
}));
|
|
14271
|
-
|
|
14272
|
-
/**
|
|
14273
|
-
* Updates a security group.
|
|
14274
|
-
*
|
|
14275
|
-
* @param request - The request {@link UpdateSecurityGroupRequest}
|
|
14276
|
-
* @returns A Promise of UpdateSecurityGroupResponse
|
|
14277
|
-
*/
|
|
14278
|
-
updateSecurityGroup = request => this.getSecurityGroup({
|
|
14279
|
-
securityGroupId: request.securityGroupId,
|
|
14280
|
-
zone: request.zone
|
|
14281
|
-
}).then(res => validateNotUndefined(res.securityGroup)).then(securityGroup => this._setSecurityGroup({
|
|
14282
|
-
creationDate: securityGroup.creationDate,
|
|
14283
|
-
description: request.description ?? securityGroup.description,
|
|
14284
|
-
enableDefaultSecurity: request.enableDefaultSecurity ?? securityGroup.enableDefaultSecurity,
|
|
14285
|
-
id: securityGroup.id,
|
|
14286
|
-
inboundDefaultPolicy: request.inboundDefaultPolicy ?? securityGroup.inboundDefaultPolicy,
|
|
14287
|
-
modificationDate: securityGroup.modificationDate,
|
|
14288
|
-
name: request.name ?? securityGroup.name,
|
|
14289
|
-
organization: securityGroup.organization,
|
|
14290
|
-
organizationDefault: request.organizationDefault ?? securityGroup.organizationDefault,
|
|
14291
|
-
outboundDefaultPolicy: request.outboundDefaultPolicy ?? securityGroup.outboundDefaultPolicy,
|
|
14292
|
-
project: securityGroup.project,
|
|
14293
|
-
projectDefault: request.projectDefault ?? securityGroup.projectDefault,
|
|
14294
|
-
servers: securityGroup.servers,
|
|
14295
|
-
stateful: request.stateful ?? securityGroup.stateful,
|
|
14296
|
-
zone: request.zone
|
|
14297
|
-
})).then(res => ({
|
|
14298
|
-
securityGroup: res.securityGroup
|
|
14299
|
-
}));
|
|
14300
|
-
|
|
14301
|
-
/**
|
|
14302
|
-
* Updates a security group rule.
|
|
14303
|
-
*
|
|
14304
|
-
* @param request - The request {@link UpdateSecurityGroupRuleRequest}
|
|
14305
|
-
* @returns A Promise of UpdateSecurityGroupRuleResponse
|
|
14306
|
-
*/
|
|
14307
|
-
updateSecurityGroupRule = request => this.getSecurityGroupRule({
|
|
14308
|
-
securityGroupId: request.securityGroupId,
|
|
14309
|
-
securityGroupRuleId: request.securityGroupRuleId,
|
|
14310
|
-
zone: request.zone
|
|
14311
|
-
}).then(res => validateNotUndefined(res.rule)).then(rule => {
|
|
14312
|
-
let sReq = {
|
|
14313
|
-
action: request.action ?? rule.action,
|
|
14314
|
-
destPortFrom: rule.destPortFrom,
|
|
14315
|
-
destPortTo: rule.destPortTo,
|
|
14316
|
-
direction: request.direction ?? rule.direction,
|
|
14317
|
-
editable: rule.editable,
|
|
14318
|
-
id: request.securityGroupRuleId,
|
|
14319
|
-
ipRange: request.ipRange ?? rule.ipRange,
|
|
14320
|
-
position: request.position ?? rule.position,
|
|
14321
|
-
protocol: request.protocol ?? rule.protocol,
|
|
14322
|
-
securityGroupId: request.securityGroupId,
|
|
14323
|
-
securityGroupRuleId: request.securityGroupRuleId
|
|
14324
|
-
};
|
|
14325
|
-
if (request.destPortFrom) {
|
|
14326
|
-
sReq = {
|
|
14327
|
-
...sReq,
|
|
14328
|
-
destPortFrom: request.destPortFrom > 0 ? request.destPortFrom : undefined
|
|
14329
|
-
};
|
|
14330
|
-
}
|
|
14331
|
-
if (request.destPortTo) {
|
|
14332
|
-
sReq = {
|
|
14333
|
-
...sReq,
|
|
14334
|
-
destPortTo: request.destPortTo > 0 ? request.destPortTo : undefined
|
|
14335
|
-
};
|
|
14336
|
-
}
|
|
14337
|
-
if (sReq.destPortFrom && sReq.destPortTo && sReq.destPortFrom === sReq.destPortTo) {
|
|
14338
|
-
sReq = {
|
|
14339
|
-
...sReq,
|
|
14340
|
-
destPortTo: undefined
|
|
14341
|
-
};
|
|
14342
|
-
}
|
|
14343
|
-
// When we use ICMP protocol portFrom and portTo should be set to nil
|
|
14344
|
-
if (request.protocol === 'ICMP') {
|
|
14345
|
-
sReq = {
|
|
14346
|
-
...sReq,
|
|
14347
|
-
destPortFrom: undefined,
|
|
14348
|
-
destPortTo: undefined
|
|
14349
|
-
};
|
|
14350
|
-
}
|
|
14351
|
-
return this._setSecurityGroupRule(sReq);
|
|
14352
|
-
}).then(res => ({
|
|
14353
|
-
rule: res.rule
|
|
14354
|
-
}));
|
|
14355
|
-
|
|
14356
14334
|
/**
|
|
14357
14335
|
* Updates a server.
|
|
14358
14336
|
*
|
|
@@ -14433,7 +14411,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14433
14411
|
id: request.volumeId,
|
|
14434
14412
|
name: request.volumeId // name is ignored on this PATCH
|
|
14435
14413
|
};
|
|
14436
|
-
|
|
14437
14414
|
found = true;
|
|
14438
14415
|
break;
|
|
14439
14416
|
}
|
|
@@ -14485,31 +14462,6 @@ class InstanceV1UtilsAPI extends API$i {
|
|
|
14485
14462
|
}).then(obj => obj);
|
|
14486
14463
|
};
|
|
14487
14464
|
|
|
14488
|
-
/**
|
|
14489
|
-
* Updates an image.
|
|
14490
|
-
*
|
|
14491
|
-
* @param request - The request {@link UpdateImageRequest}
|
|
14492
|
-
* @returns A Promise of UpdateImageResponse
|
|
14493
|
-
*/
|
|
14494
|
-
updateImage = request => this.getImage({
|
|
14495
|
-
zone: request.zone,
|
|
14496
|
-
imageId: request.imageId
|
|
14497
|
-
}).then(res => validateNotUndefined(res.image)).then(image => ({
|
|
14498
|
-
...image,
|
|
14499
|
-
name: request.name ?? image.name,
|
|
14500
|
-
tags: request.tags ?? image.tags,
|
|
14501
|
-
id: image.id
|
|
14502
|
-
})).then(imageReq => this.client.fetch({
|
|
14503
|
-
body: JSON.stringify(marshalSetImageRequestWithID(imageReq, this.client.settings)),
|
|
14504
|
-
headers: {
|
|
14505
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
14506
|
-
},
|
|
14507
|
-
method: 'PUT',
|
|
14508
|
-
path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone)}/images/${validatePathParam('id', imageReq.id)}`
|
|
14509
|
-
}, unmarshalSetImageResponse)).then(res => ({
|
|
14510
|
-
image: res.image
|
|
14511
|
-
}));
|
|
14512
|
-
|
|
14513
14465
|
/**
|
|
14514
14466
|
* Get the content of a user data on a server for the given key.
|
|
14515
14467
|
*
|
|
@@ -16275,10 +16227,6 @@ const jsonContentHeaders$d = {
|
|
|
16275
16227
|
let API$e = class API extends API$v {
|
|
16276
16228
|
/** Lists the available regions of the API. */
|
|
16277
16229
|
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
16278
|
-
getServiceInfo = (request = {}) => this.client.fetch({
|
|
16279
|
-
method: 'GET',
|
|
16280
|
-
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}`
|
|
16281
|
-
}, unmarshalServiceInfo);
|
|
16282
16230
|
createJobDefinition = request => this.client.fetch({
|
|
16283
16231
|
body: JSON.stringify(marshalCreateJobDefinitionRequest(request, this.client.settings)),
|
|
16284
16232
|
headers: jsonContentHeaders$d,
|
|
@@ -16586,12 +16534,16 @@ const unmarshalExternalNode = data => {
|
|
|
16586
16534
|
return {
|
|
16587
16535
|
clusterCa: data.cluster_ca,
|
|
16588
16536
|
clusterUrl: data.cluster_url,
|
|
16537
|
+
cniPluginsVersion: data.cni_plugins_version,
|
|
16538
|
+
containerdVersion: data.containerd_version,
|
|
16589
16539
|
externalIp: data.external_ip,
|
|
16590
16540
|
id: data.id,
|
|
16591
16541
|
kubeToken: data.kube_token,
|
|
16592
16542
|
kubeletConfig: data.kubelet_config,
|
|
16593
16543
|
name: data.name,
|
|
16594
|
-
|
|
16544
|
+
nodeLabels: data.node_labels,
|
|
16545
|
+
poolVersion: data.pool_version,
|
|
16546
|
+
runcVersion: data.runc_version
|
|
16595
16547
|
};
|
|
16596
16548
|
};
|
|
16597
16549
|
const unmarshalClusterType = data => {
|
|
@@ -26345,11 +26297,14 @@ const unmarshalHosting = data => {
|
|
|
26345
26297
|
dnsStatus: data.dns_status,
|
|
26346
26298
|
domain: data.domain,
|
|
26347
26299
|
id: data.id,
|
|
26300
|
+
ipv4: data.ipv4,
|
|
26301
|
+
ipv6: data.ipv6,
|
|
26348
26302
|
offerEndOfLife: data.offer_end_of_life,
|
|
26349
26303
|
offerId: data.offer_id,
|
|
26350
26304
|
offerName: data.offer_name,
|
|
26351
26305
|
options: unmarshalArrayOfObject(data.options, unmarshalHostingOption),
|
|
26352
26306
|
organizationId: data.organization_id,
|
|
26307
|
+
platformGroup: data.platform_group,
|
|
26353
26308
|
platformHostname: data.platform_hostname,
|
|
26354
26309
|
platformNumber: data.platform_number,
|
|
26355
26310
|
projectId: data.project_id,
|
|
@@ -26606,7 +26561,7 @@ class API extends API$v {
|
|
|
26606
26561
|
listOffers = request => this.client.fetch({
|
|
26607
26562
|
method: 'GET',
|
|
26608
26563
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,
|
|
26609
|
-
urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy], ['without_options', request.withoutOptions])
|
|
26564
|
+
urlParams: urlParams(['control_panels', request.controlPanels], ['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy], ['without_options', request.withoutOptions])
|
|
26610
26565
|
}, unmarshalListOffersResponse);
|
|
26611
26566
|
pageOfListControlPanels = (request = {}) => this.client.fetch({
|
|
26612
26567
|
method: 'GET',
|