@scaleway/sdk 0.1.0-beta.5 → 0.1.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  This SDK enables you to interact with Scaleway APIs.
4
4
 
5
5
  **🔗  Important links:**
6
- * Reference documentation (soon)
6
+ * [Reference documentation](https://scaleway.github.io/scaleway-sdk-js)
7
7
  * [Example projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
8
8
  * [Developers website](https://developers.scaleway.com) (API documentation)
9
9
 
@@ -2,7 +2,7 @@ import { API } from '../../../scw/api.js';
2
2
  import { unmarshalScwFile } from '../../../scw/custom-marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
4
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
5
- import { unmarshalListDNSZonesResponse, marshalCreateDNSZoneRequest, unmarshalDNSZone, marshalUpdateDNSZoneRequest, marshalCloneDNSZoneRequest, unmarshalDeleteDNSZoneResponse, unmarshalListDNSZoneRecordsResponse, marshalUpdateDNSZoneRecordsRequest, unmarshalUpdateDNSZoneRecordsResponse, unmarshalListDNSZoneNameserversResponse, marshalUpdateDNSZoneNameserversRequest, unmarshalUpdateDNSZoneNameserversResponse, unmarshalClearDNSZoneRecordsResponse, marshalImportRawDNSZoneRequest, unmarshalImportRawDNSZoneResponse, marshalImportProviderDNSZoneRequest, unmarshalImportProviderDNSZoneResponse, marshalRefreshDNSZoneRequest, unmarshalRefreshDNSZoneResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, marshalCreateSSLCertificateRequest, unmarshalListSSLCertificatesResponse, unmarshalDeleteSSLCertificateResponse, unmarshalGetDNSZoneTsigKeyResponse, unmarshalListTasksResponse, marshalRegistrarApiBuyDomainsRequest, unmarshalOrderResponse, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiRegisterExternalDomainRequest, unmarshalRegisterExternalDomainResponse, unmarshalDeleteExternalDomainResponse, unmarshalListContactsResponse, unmarshalContact, marshalRegistrarApiUpdateContactRequest, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalDomain, marshalRegistrarApiUpdateDomainRequest, unmarshalGetDomainAuthCodeResponse, marshalRegistrarApiEnableDomainDNSSECRequest, unmarshalSearchAvailableDomainsResponse } from './marshalling.gen.js';
5
+ import { unmarshalListDNSZonesResponse, marshalCreateDNSZoneRequest, unmarshalDNSZone, marshalUpdateDNSZoneRequest, marshalCloneDNSZoneRequest, unmarshalDeleteDNSZoneResponse, unmarshalListDNSZoneRecordsResponse, marshalUpdateDNSZoneRecordsRequest, unmarshalUpdateDNSZoneRecordsResponse, unmarshalListDNSZoneNameserversResponse, marshalUpdateDNSZoneNameserversRequest, unmarshalUpdateDNSZoneNameserversResponse, unmarshalClearDNSZoneRecordsResponse, marshalImportRawDNSZoneRequest, unmarshalImportRawDNSZoneResponse, marshalImportProviderDNSZoneRequest, unmarshalImportProviderDNSZoneResponse, marshalRefreshDNSZoneRequest, unmarshalRefreshDNSZoneResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, marshalCreateSSLCertificateRequest, unmarshalListSSLCertificatesResponse, unmarshalDeleteSSLCertificateResponse, unmarshalGetDNSZoneTsigKeyResponse, unmarshalListTasksResponse, marshalRegistrarApiBuyDomainsRequest, unmarshalOrderResponse, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiRegisterExternalDomainRequest, unmarshalRegisterExternalDomainResponse, unmarshalDeleteExternalDomainResponse, marshalRegistrarApiCheckContactsCompatibilityRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalListContactsResponse, unmarshalContact, marshalRegistrarApiUpdateContactRequest, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalDomain, marshalRegistrarApiUpdateDomainRequest, unmarshalGetDomainAuthCodeResponse, marshalRegistrarApiEnableDomainDNSSECRequest, unmarshalSearchAvailableDomainsResponse } from './marshalling.gen.js';
6
6
 
7
7
  // This file was automatically generated. DO NOT EDIT.
8
8
  const jsonContentHeaders = {
@@ -239,6 +239,19 @@ class DomainRegistrarV2Beta1GenAPI extends API {
239
239
  path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`
240
240
  }, unmarshalDeleteExternalDomainResponse);
241
241
 
242
+ this.checkContactsCompatibility = function (request) {
243
+ if (request === void 0) {
244
+ request = {};
245
+ }
246
+
247
+ return _this.client.fetch({
248
+ body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, _this.client.settings)),
249
+ headers: jsonContentHeaders,
250
+ method: 'POST',
251
+ path: `/domain/v2beta1/check-contacts-compatibility`
252
+ }, unmarshalCheckContactsCompatibilityResponse);
253
+ };
254
+
242
255
  this.pageOfListContacts = function (request) {
243
256
  if (request === void 0) {
244
257
  request = {};
@@ -399,6 +399,17 @@ const unmarshalAvailableDomain = data => {
399
399
  };
400
400
  };
401
401
 
402
+ const unmarshalCheckContactsCompatibilityResponseContactCheckResult = data => {
403
+ if (!isJSONObject(data)) {
404
+ throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`);
405
+ }
406
+
407
+ return {
408
+ compatible: data.compatible,
409
+ errorMessage: data.error_message
410
+ };
411
+ };
412
+
402
413
  const unmarshalContactRoles = data => {
403
414
  if (!isJSONObject(data)) {
404
415
  throw new TypeError(`Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`);
@@ -545,6 +556,18 @@ const unmarshalTask = data => {
545
556
  };
546
557
  };
547
558
 
559
+ const unmarshalCheckContactsCompatibilityResponse = data => {
560
+ if (!isJSONObject(data)) {
561
+ throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`);
562
+ }
563
+
564
+ return {
565
+ administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.administrative_check_result) : undefined,
566
+ compatible: data.compatible,
567
+ ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.owner_check_result) : undefined,
568
+ technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.technical_check_result) : undefined
569
+ };
570
+ };
548
571
  const unmarshalClearDNSZoneRecordsResponse = data => {
549
572
  if (!isJSONObject(data)) {
550
573
  throw new TypeError(`Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`);
@@ -1121,6 +1144,35 @@ const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({
1121
1144
  value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined
1122
1145
  }])
1123
1146
  });
1147
+ const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({ ...resolveOneOf([{
1148
+ param: 'administrative_contact_id',
1149
+ value: request.administrativeContactId
1150
+ }, {
1151
+ param: 'administrative_contact',
1152
+ value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined
1153
+ }]),
1154
+ ...resolveOneOf([{
1155
+ param: 'owner_contact_id',
1156
+ value: request.ownerContactId
1157
+ }, {
1158
+ param: 'owner_contact',
1159
+ value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined
1160
+ }]),
1161
+ ...resolveOneOf([{
1162
+ param: 'domain',
1163
+ value: request.domain
1164
+ }, {
1165
+ param: 'tld',
1166
+ value: request.tld
1167
+ }]),
1168
+ ...resolveOneOf([{
1169
+ param: 'technical_contact_id',
1170
+ value: request.technicalContactId
1171
+ }, {
1172
+ param: 'technical_contact',
1173
+ value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined
1174
+ }])
1175
+ });
1124
1176
  const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({
1125
1177
  ds_record: request.dsRecord ? marshalDSRecord(request.dsRecord) : undefined
1126
1178
  });
@@ -1225,4 +1277,4 @@ const marshalUpdateDNSZoneRequest = (request, defaults) => ({
1225
1277
  project_id: request.projectId ?? defaults.defaultProjectId
1226
1278
  });
1227
1279
 
1228
- export { marshalCloneDNSZoneRequest, marshalCreateDNSZoneRequest, marshalCreateSSLCertificateRequest, marshalImportProviderDNSZoneRequest, marshalImportRawDNSZoneRequest, marshalRefreshDNSZoneRequest, marshalRegistrarApiBuyDomainsRequest, marshalRegistrarApiEnableDomainDNSSECRequest, marshalRegistrarApiRegisterExternalDomainRequest, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiUpdateContactRequest, marshalRegistrarApiUpdateDomainRequest, marshalUpdateDNSZoneNameserversRequest, marshalUpdateDNSZoneRecordsRequest, marshalUpdateDNSZoneRequest, unmarshalClearDNSZoneRecordsResponse, unmarshalContact, unmarshalDNSZone, unmarshalDeleteDNSZoneResponse, unmarshalDeleteExternalDomainResponse, unmarshalDeleteSSLCertificateResponse, unmarshalDomain, unmarshalGetDNSZoneTsigKeyResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalGetDomainAuthCodeResponse, unmarshalImportProviderDNSZoneResponse, unmarshalImportRawDNSZoneResponse, unmarshalListContactsResponse, unmarshalListDNSZoneNameserversResponse, unmarshalListDNSZoneRecordsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZonesResponse, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalListSSLCertificatesResponse, unmarshalListTasksResponse, unmarshalOrderResponse, unmarshalRefreshDNSZoneResponse, unmarshalRegisterExternalDomainResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, unmarshalSearchAvailableDomainsResponse, unmarshalUpdateDNSZoneNameserversResponse, unmarshalUpdateDNSZoneRecordsResponse };
1280
+ export { marshalCloneDNSZoneRequest, marshalCreateDNSZoneRequest, marshalCreateSSLCertificateRequest, marshalImportProviderDNSZoneRequest, marshalImportRawDNSZoneRequest, marshalRefreshDNSZoneRequest, marshalRegistrarApiBuyDomainsRequest, marshalRegistrarApiCheckContactsCompatibilityRequest, marshalRegistrarApiEnableDomainDNSSECRequest, marshalRegistrarApiRegisterExternalDomainRequest, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiUpdateContactRequest, marshalRegistrarApiUpdateDomainRequest, marshalUpdateDNSZoneNameserversRequest, marshalUpdateDNSZoneRecordsRequest, marshalUpdateDNSZoneRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalClearDNSZoneRecordsResponse, unmarshalContact, unmarshalDNSZone, unmarshalDeleteDNSZoneResponse, unmarshalDeleteExternalDomainResponse, unmarshalDeleteSSLCertificateResponse, unmarshalDomain, unmarshalGetDNSZoneTsigKeyResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalGetDomainAuthCodeResponse, unmarshalImportProviderDNSZoneResponse, unmarshalImportRawDNSZoneResponse, unmarshalListContactsResponse, unmarshalListDNSZoneNameserversResponse, unmarshalListDNSZoneRecordsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZonesResponse, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalListSSLCertificatesResponse, unmarshalListTasksResponse, unmarshalOrderResponse, unmarshalRefreshDNSZoneResponse, unmarshalRegisterExternalDomainResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, unmarshalSearchAvailableDomainsResponse, unmarshalUpdateDNSZoneNameserversResponse, unmarshalUpdateDNSZoneRecordsResponse };
@@ -1,3 +1,4 @@
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js';
1
2
  import { isJSONObject } from '../../../helpers/json.js';
2
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
3
4
 
@@ -265,17 +266,17 @@ const marshalCreateAPIKeyRequest = (request, defaults) => ({
265
266
  });
266
267
  const marshalCreateApplicationRequest = (request, defaults) => ({
267
268
  description: request.description,
268
- name: request.name,
269
+ name: request.name || randomName('app'),
269
270
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
270
271
  });
271
272
  const marshalCreateGroupRequest = (request, defaults) => ({
272
273
  description: request.description,
273
- name: request.name,
274
+ name: request.name || randomName('grp'),
274
275
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
275
276
  });
276
277
  const marshalCreatePolicyRequest = (request, defaults) => ({
277
278
  description: request.description,
278
- name: request.name,
279
+ name: request.name || randomName('pol'),
279
280
  organization_id: request.organizationId ?? defaults.defaultOrganizationId,
280
281
  rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) : undefined,
281
282
  ...resolveOneOf([{
@@ -293,7 +294,7 @@ const marshalCreatePolicyRequest = (request, defaults) => ({
293
294
  }])
294
295
  });
295
296
  const marshalCreateSSHKeyRequest = (request, defaults) => ({
296
- name: request.name,
297
+ name: request.name || randomName('key'),
297
298
  project_id: request.projectId ?? defaults.defaultProjectId,
298
299
  public_key: request.publicKey
299
300
  });
@@ -1,7 +1,7 @@
1
1
  import { API } from '../../../scw/api.js';
2
2
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalGetServerTypesAvailabilityResponse, unmarshalListServersTypesResponse, unmarshalListVolumesTypesResponse, unmarshalListServersResponse, marshalCreateServerRequest, unmarshalCreateServerResponse, unmarshalGetServerResponse, marshalSetServerRequest, unmarshalSetServerResponse, marshalUpdateServerRequest, unmarshalUpdateServerResponse, unmarshalListServerActionsResponse, marshalServerActionRequest, unmarshalServerActionResponse, unmarshalListServerUserDataResponse, unmarshalListImagesResponse, unmarshalGetImageResponse, marshalCreateImageRequest, unmarshalCreateImageResponse, marshalSetImageRequest, unmarshalSetImageResponse, unmarshalListSnapshotsResponse, marshalCreateSnapshotRequest, unmarshalCreateSnapshotResponse, unmarshalGetSnapshotResponse, marshalSetSnapshotRequest, unmarshalSetSnapshotResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalCreateVolumeResponse, unmarshalGetVolumeResponse, marshalUpdateVolumeRequest, unmarshalUpdateVolumeResponse, unmarshalListSecurityGroupsResponse, marshalCreateSecurityGroupRequest, unmarshalCreateSecurityGroupResponse, unmarshalGetSecurityGroupResponse, marshalSetSecurityGroupRequest, unmarshalSetSecurityGroupResponse, unmarshalListSecurityGroupRulesResponse, marshalCreateSecurityGroupRuleRequest, unmarshalCreateSecurityGroupRuleResponse, marshalSetSecurityGroupRulesRequest, unmarshalSetSecurityGroupRulesResponse, unmarshalGetSecurityGroupRuleResponse, marshalSetSecurityGroupRuleRequest, unmarshalSetSecurityGroupRuleResponse, unmarshalListPlacementGroupsResponse, marshalCreatePlacementGroupRequest, unmarshalCreatePlacementGroupResponse, unmarshalGetPlacementGroupResponse, marshalSetPlacementGroupRequest, unmarshalSetPlacementGroupResponse, marshalUpdatePlacementGroupRequest, unmarshalUpdatePlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, marshalSetPlacementGroupServersRequest, unmarshalSetPlacementGroupServersResponse, marshalUpdatePlacementGroupServersRequest, unmarshalUpdatePlacementGroupServersResponse, unmarshalListIpsResponse, marshalCreateIpRequest, unmarshalCreateIpResponse, unmarshalGetIpResponse, marshalUpdateIpRequest, unmarshalUpdateIpResponse, unmarshalListPrivateNICsResponse, marshalCreatePrivateNICRequest, unmarshalCreatePrivateNICResponse, unmarshalGetPrivateNICResponse, unmarshalListBootscriptsResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse } from './marshalling.gen.js';
4
+ import { unmarshalGetServerTypesAvailabilityResponse, unmarshalListServersTypesResponse, unmarshalListVolumesTypesResponse, unmarshalListServersResponse, marshalCreateServerRequest, unmarshalCreateServerResponse, unmarshalGetServerResponse, marshalSetServerRequest, unmarshalSetServerResponse, marshalUpdateServerRequest, unmarshalUpdateServerResponse, unmarshalListServerActionsResponse, marshalServerActionRequest, unmarshalServerActionResponse, unmarshalListServerUserDataResponse, unmarshalListImagesResponse, unmarshalGetImageResponse, marshalCreateImageRequest, unmarshalCreateImageResponse, marshalSetImageRequest, unmarshalSetImageResponse, unmarshalListSnapshotsResponse, marshalCreateSnapshotRequest, unmarshalCreateSnapshotResponse, unmarshalGetSnapshotResponse, marshalSetSnapshotRequest, unmarshalSetSnapshotResponse, marshalExportSnapshotRequest, unmarshalExportSnapshotResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalCreateVolumeResponse, unmarshalGetVolumeResponse, marshalUpdateVolumeRequest, unmarshalUpdateVolumeResponse, unmarshalListSecurityGroupsResponse, marshalCreateSecurityGroupRequest, unmarshalCreateSecurityGroupResponse, unmarshalGetSecurityGroupResponse, marshalSetSecurityGroupRequest, unmarshalSetSecurityGroupResponse, unmarshalListSecurityGroupRulesResponse, marshalCreateSecurityGroupRuleRequest, unmarshalCreateSecurityGroupRuleResponse, marshalSetSecurityGroupRulesRequest, unmarshalSetSecurityGroupRulesResponse, unmarshalGetSecurityGroupRuleResponse, marshalSetSecurityGroupRuleRequest, unmarshalSetSecurityGroupRuleResponse, unmarshalListPlacementGroupsResponse, marshalCreatePlacementGroupRequest, unmarshalCreatePlacementGroupResponse, unmarshalGetPlacementGroupResponse, marshalSetPlacementGroupRequest, unmarshalSetPlacementGroupResponse, marshalUpdatePlacementGroupRequest, unmarshalUpdatePlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, marshalSetPlacementGroupServersRequest, unmarshalSetPlacementGroupServersResponse, marshalUpdatePlacementGroupServersRequest, unmarshalUpdatePlacementGroupServersResponse, unmarshalListIpsResponse, marshalCreateIpRequest, unmarshalCreateIpResponse, unmarshalGetIpResponse, marshalUpdateIpRequest, unmarshalUpdateIpResponse, unmarshalListPrivateNICsResponse, marshalCreatePrivateNICRequest, unmarshalCreatePrivateNICResponse, unmarshalGetPrivateNICResponse, unmarshalListBootscriptsResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse } from './marshalling.gen.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  const jsonContentHeaders = {
@@ -213,6 +213,13 @@ class InstanceV1GenAPI extends API {
213
213
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
214
214
  });
215
215
 
216
+ this.exportSnapshot = request => this.client.fetch({
217
+ body: JSON.stringify(marshalExportSnapshotRequest(request, this.client.settings)),
218
+ headers: jsonContentHeaders,
219
+ method: 'POST',
220
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/export`
221
+ }, unmarshalExportSnapshotResponse);
222
+
216
223
  this.pageOfListVolumes = function (request) {
217
224
  if (request === void 0) {
218
225
  request = {};
@@ -292,12 +292,18 @@ const unmarshalDashboard = data => {
292
292
  imagesCount: data.images_count,
293
293
  ipsCount: data.ips_count,
294
294
  ipsUnused: data.ips_unused,
295
+ placementGroupsCount: data.placement_groups_count,
296
+ privateNicsCount: data.private_nics_count,
295
297
  runningServersCount: data.running_servers_count,
296
298
  securityGroupsCount: data.security_groups_count,
297
299
  serversByTypes: data.servers_by_types,
298
300
  serversCount: data.servers_count,
299
301
  snapshotsCount: data.snapshots_count,
300
- volumesCount: data.volumes_count
302
+ volumesBSsdCount: data.volumes_b_ssd_count,
303
+ volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
304
+ volumesCount: data.volumes_count,
305
+ volumesLSsdCount: data.volumes_l_ssd_count,
306
+ volumesLSsdTotalSize: data.volumes_l_ssd_total_size
301
307
  };
302
308
  };
303
309
 
@@ -451,6 +457,7 @@ const unmarshalSnapshot = data => {
451
457
  return {
452
458
  baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined,
453
459
  creationDate: unmarshalDate(data.creation_date),
460
+ errorReason: data.error_reason,
454
461
  id: data.id,
455
462
  modificationDate: unmarshalDate(data.modification_date),
456
463
  name: data.name,
@@ -579,6 +586,15 @@ const unmarshalCreateVolumeResponse = data => {
579
586
  volume: data.volume ? unmarshalVolume(data.volume) : undefined
580
587
  };
581
588
  };
589
+ const unmarshalExportSnapshotResponse = data => {
590
+ if (!isJSONObject(data)) {
591
+ throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);
592
+ }
593
+
594
+ return {
595
+ task: data.task ? unmarshalTask(data.task) : undefined
596
+ };
597
+ };
582
598
  const unmarshalGetBootscriptResponse = data => {
583
599
  if (!isJSONObject(data)) {
584
600
  throw new TypeError(`Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`);
@@ -1250,7 +1266,10 @@ const marshalCreateServerRequest = (request, defaults) => ({
1250
1266
  }])
1251
1267
  });
1252
1268
  const marshalCreateSnapshotRequest = (request, defaults) => ({
1269
+ bucket: request.bucket,
1270
+ key: request.key,
1253
1271
  name: request.name || randomName('snp'),
1272
+ size: request.size,
1254
1273
  tags: request.tags,
1255
1274
  volume_id: request.volumeId,
1256
1275
  volume_type: request.volumeType,
@@ -1288,6 +1307,10 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
1288
1307
  value: request.baseSnapshot
1289
1308
  }])
1290
1309
  });
1310
+ const marshalExportSnapshotRequest = (request, defaults) => ({
1311
+ bucket: request.bucket,
1312
+ key: request.key
1313
+ });
1291
1314
  const marshalServerActionRequest = (request, defaults) => ({
1292
1315
  action: request.action,
1293
1316
  name: request.name,
@@ -1444,4 +1467,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
1444
1467
  tags: request.tags
1445
1468
  });
1446
1469
 
1447
- export { marshalCreateImageRequest, marshalCreateIpRequest, marshalCreatePlacementGroupRequest, marshalCreatePrivateNICRequest, marshalCreateSecurityGroupRequest, marshalCreateSecurityGroupRuleRequest, marshalCreateServerRequest, marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalServerActionRequest, marshalSetImageRequest, marshalSetPlacementGroupRequest, marshalSetPlacementGroupServersRequest, marshalSetSecurityGroupRequest, marshalSetSecurityGroupRuleRequest, marshalSetSecurityGroupRulesRequest, marshalSetServerRequest, marshalSetSnapshotRequest, marshalUpdateIpRequest, marshalUpdatePlacementGroupRequest, marshalUpdatePlacementGroupServersRequest, marshalUpdateServerRequest, marshalUpdateVolumeRequest, unmarshalCreateImageResponse, unmarshalCreateIpResponse, unmarshalCreatePlacementGroupResponse, unmarshalCreatePrivateNICResponse, unmarshalCreateSecurityGroupResponse, unmarshalCreateSecurityGroupRuleResponse, unmarshalCreateServerResponse, unmarshalCreateSnapshotResponse, unmarshalCreateVolumeResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, unmarshalGetPrivateNICResponse, unmarshalGetSecurityGroupResponse, unmarshalGetSecurityGroupRuleResponse, unmarshalGetServerResponse, unmarshalGetServerTypesAvailabilityResponse, unmarshalGetSnapshotResponse, unmarshalGetVolumeResponse, unmarshalListBootscriptsResponse, unmarshalListImagesResponse, unmarshalListIpsResponse, unmarshalListPlacementGroupsResponse, unmarshalListPrivateNICsResponse, unmarshalListSecurityGroupRulesResponse, unmarshalListSecurityGroupsResponse, unmarshalListServerActionsResponse, unmarshalListServerUserDataResponse, unmarshalListServersResponse, unmarshalListServersTypesResponse, unmarshalListSnapshotsResponse, unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalServerActionResponse, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, unmarshalSetSecurityGroupResponse, unmarshalSetSecurityGroupRuleResponse, unmarshalSetSecurityGroupRulesResponse, unmarshalSetServerResponse, unmarshalSetSnapshotResponse, unmarshalUpdateIpResponse, unmarshalUpdatePlacementGroupResponse, unmarshalUpdatePlacementGroupServersResponse, unmarshalUpdateServerResponse, unmarshalUpdateVolumeResponse };
1470
+ export { marshalCreateImageRequest, marshalCreateIpRequest, marshalCreatePlacementGroupRequest, marshalCreatePrivateNICRequest, marshalCreateSecurityGroupRequest, marshalCreateSecurityGroupRuleRequest, marshalCreateServerRequest, marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotRequest, marshalServerActionRequest, marshalSetImageRequest, marshalSetPlacementGroupRequest, marshalSetPlacementGroupServersRequest, marshalSetSecurityGroupRequest, marshalSetSecurityGroupRuleRequest, marshalSetSecurityGroupRulesRequest, marshalSetServerRequest, marshalSetSnapshotRequest, marshalUpdateIpRequest, marshalUpdatePlacementGroupRequest, marshalUpdatePlacementGroupServersRequest, marshalUpdateServerRequest, marshalUpdateVolumeRequest, unmarshalCreateImageResponse, unmarshalCreateIpResponse, unmarshalCreatePlacementGroupResponse, unmarshalCreatePrivateNICResponse, unmarshalCreateSecurityGroupResponse, unmarshalCreateSecurityGroupRuleResponse, unmarshalCreateServerResponse, unmarshalCreateSnapshotResponse, unmarshalCreateVolumeResponse, unmarshalExportSnapshotResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, unmarshalGetPrivateNICResponse, unmarshalGetSecurityGroupResponse, unmarshalGetSecurityGroupRuleResponse, unmarshalGetServerResponse, unmarshalGetServerTypesAvailabilityResponse, unmarshalGetSnapshotResponse, unmarshalGetVolumeResponse, unmarshalListBootscriptsResponse, unmarshalListImagesResponse, unmarshalListIpsResponse, unmarshalListPlacementGroupsResponse, unmarshalListPrivateNICsResponse, unmarshalListSecurityGroupRulesResponse, unmarshalListSecurityGroupsResponse, unmarshalListServerActionsResponse, unmarshalListServerUserDataResponse, unmarshalListServersResponse, unmarshalListServersTypesResponse, unmarshalListSnapshotsResponse, unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalServerActionResponse, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, unmarshalSetSecurityGroupResponse, unmarshalSetSecurityGroupRuleResponse, unmarshalSetSecurityGroupRulesResponse, unmarshalSetServerResponse, unmarshalSetSnapshotResponse, unmarshalUpdateIpResponse, unmarshalUpdatePlacementGroupResponse, unmarshalUpdatePlacementGroupServersResponse, unmarshalUpdateServerResponse, unmarshalUpdateVolumeResponse };
package/dist/index.cjs CHANGED
@@ -367,7 +367,7 @@ const assertValidSettings = obj => {
367
367
  if (typeof obj.userAgent !== 'string') throw new Error(`Invalid User-Agent`);
368
368
  };
369
369
 
370
- const version = 'v0.1.0-beta.4';
370
+ const version = 'v0.1.0-beta.7';
371
371
  const userAgent = `scaleway-sdk-js/${version}`;
372
372
 
373
373
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -953,30 +953,13 @@ class PermissionsDeniedError extends ScalewayError {
953
953
  */
954
954
 
955
955
  const buildMessage$1 = (precondition, helpMessage) => {
956
- let message;
957
-
958
- switch (precondition) {
959
- case 'unknown_precondition':
960
- message = 'unknown precondition';
961
- break;
962
-
963
- case 'resource_still_in_use':
964
- message = 'resource is still in use';
965
- break;
966
-
967
- case 'attribute_must_be_set':
968
- message = 'attribute must be set';
969
- break;
970
-
971
- default:
972
- message = '';
973
- }
956
+ let message = `precondition failed: ${precondition}`;
974
957
 
975
958
  if (typeof helpMessage === 'string' && helpMessage.length > 0) {
976
959
  message = message.concat(', ', helpMessage);
977
960
  }
978
961
 
979
- return `precondition failed: ${message}`;
962
+ return message;
980
963
  };
981
964
  /**
982
965
  * PreconditionFailed error is used when a precondition is not respected.
@@ -4561,6 +4544,17 @@ const unmarshalAvailableDomain = data => {
4561
4544
  };
4562
4545
  };
4563
4546
 
4547
+ const unmarshalCheckContactsCompatibilityResponseContactCheckResult = data => {
4548
+ if (!isJSONObject(data)) {
4549
+ throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`);
4550
+ }
4551
+
4552
+ return {
4553
+ compatible: data.compatible,
4554
+ errorMessage: data.error_message
4555
+ };
4556
+ };
4557
+
4564
4558
  const unmarshalContactRoles = data => {
4565
4559
  if (!isJSONObject(data)) {
4566
4560
  throw new TypeError(`Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`);
@@ -4707,6 +4701,18 @@ const unmarshalTask$1 = data => {
4707
4701
  };
4708
4702
  };
4709
4703
 
4704
+ const unmarshalCheckContactsCompatibilityResponse = data => {
4705
+ if (!isJSONObject(data)) {
4706
+ throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`);
4707
+ }
4708
+
4709
+ return {
4710
+ administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.administrative_check_result) : undefined,
4711
+ compatible: data.compatible,
4712
+ ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.owner_check_result) : undefined,
4713
+ technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.technical_check_result) : undefined
4714
+ };
4715
+ };
4710
4716
  const unmarshalClearDNSZoneRecordsResponse = data => {
4711
4717
  if (!isJSONObject(data)) {
4712
4718
  throw new TypeError(`Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`);
@@ -5283,6 +5289,35 @@ const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({
5283
5289
  value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined
5284
5290
  }])
5285
5291
  });
5292
+ const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({ ...resolveOneOf([{
5293
+ param: 'administrative_contact_id',
5294
+ value: request.administrativeContactId
5295
+ }, {
5296
+ param: 'administrative_contact',
5297
+ value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined
5298
+ }]),
5299
+ ...resolveOneOf([{
5300
+ param: 'owner_contact_id',
5301
+ value: request.ownerContactId
5302
+ }, {
5303
+ param: 'owner_contact',
5304
+ value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined
5305
+ }]),
5306
+ ...resolveOneOf([{
5307
+ param: 'domain',
5308
+ value: request.domain
5309
+ }, {
5310
+ param: 'tld',
5311
+ value: request.tld
5312
+ }]),
5313
+ ...resolveOneOf([{
5314
+ param: 'technical_contact_id',
5315
+ value: request.technicalContactId
5316
+ }, {
5317
+ param: 'technical_contact',
5318
+ value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined
5319
+ }])
5320
+ });
5286
5321
  const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({
5287
5322
  ds_record: request.dsRecord ? marshalDSRecord(request.dsRecord) : undefined
5288
5323
  });
@@ -5817,6 +5852,20 @@ class DomainRegistrarV2Beta1GenAPI extends API {
5817
5852
  method: 'DELETE',
5818
5853
  path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`
5819
5854
  }, unmarshalDeleteExternalDomainResponse);
5855
+ /**
5856
+ * Check if contacts are compatible against a domain or a tld. If not, it will
5857
+ * return the information requiring a correction.
5858
+ *
5859
+ * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
5860
+ * @returns A Promise of CheckContactsCompatibilityResponse
5861
+ */
5862
+
5863
+ checkContactsCompatibility = (request = {}) => this.client.fetch({
5864
+ body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)),
5865
+ headers: jsonContentHeaders$e,
5866
+ method: 'POST',
5867
+ path: `/domain/v2beta1/check-contacts-compatibility`
5868
+ }, unmarshalCheckContactsCompatibilityResponse);
5820
5869
  pageOfListContacts = (request = {}) => this.client.fetch({
5821
5870
  method: 'GET',
5822
5871
  path: `/domain/v2beta1/contacts`,
@@ -7306,17 +7355,17 @@ const marshalCreateAPIKeyRequest = (request, defaults) => ({
7306
7355
  });
7307
7356
  const marshalCreateApplicationRequest = (request, defaults) => ({
7308
7357
  description: request.description,
7309
- name: request.name,
7358
+ name: request.name || randomName('app'),
7310
7359
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
7311
7360
  });
7312
7361
  const marshalCreateGroupRequest = (request, defaults) => ({
7313
7362
  description: request.description,
7314
- name: request.name,
7363
+ name: request.name || randomName('grp'),
7315
7364
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
7316
7365
  });
7317
7366
  const marshalCreatePolicyRequest = (request, defaults) => ({
7318
7367
  description: request.description,
7319
- name: request.name,
7368
+ name: request.name || randomName('pol'),
7320
7369
  organization_id: request.organizationId ?? defaults.defaultOrganizationId,
7321
7370
  rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) : undefined,
7322
7371
  ...resolveOneOf([{
@@ -7334,7 +7383,7 @@ const marshalCreatePolicyRequest = (request, defaults) => ({
7334
7383
  }])
7335
7384
  });
7336
7385
  const marshalCreateSSHKeyRequest = (request, defaults) => ({
7337
- name: request.name,
7386
+ name: request.name || randomName('key'),
7338
7387
  project_id: request.projectId ?? defaults.defaultProjectId,
7339
7388
  public_key: request.publicKey
7340
7389
  });
@@ -7409,7 +7458,7 @@ class IamV1Alpha1GenAPI extends API {
7409
7458
 
7410
7459
  listSSHKeys = (request = {}) => enrichForPagination('sshKeys', this.pageOfListSSHKeys, request);
7411
7460
  /**
7412
- * Add an SSH key
7461
+ * Create an SSH key
7413
7462
  *
7414
7463
  * @param request - The request {@link CreateSSHKeyRequest}
7415
7464
  * @returns A Promise of SSHKey
@@ -7446,7 +7495,7 @@ class IamV1Alpha1GenAPI extends API {
7446
7495
  path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`
7447
7496
  }, unmarshalSSHKey);
7448
7497
  /**
7449
- * Remove an SSH key
7498
+ * Delete an SSH key
7450
7499
  *
7451
7500
  * @param request - The request {@link DeleteSSHKeyRequest}
7452
7501
  */
@@ -7553,7 +7602,7 @@ class IamV1Alpha1GenAPI extends API {
7553
7602
 
7554
7603
  listGroups = (request = {}) => enrichForPagination('groups', this.pageOfListGroups, request);
7555
7604
  /**
7556
- * Add a new group
7605
+ * Create a new group
7557
7606
  *
7558
7607
  * @param request - The request {@link CreateGroupRequest}
7559
7608
  * @returns A Promise of Group
@@ -7757,7 +7806,7 @@ class IamV1Alpha1GenAPI extends API {
7757
7806
 
7758
7807
  listAPIKeys = (request = {}) => enrichForPagination('apiKeys', this.pageOfListAPIKeys, request);
7759
7808
  /**
7760
- * Add an API key
7809
+ * Create an API key
7761
7810
  *
7762
7811
  * @param request - The request {@link CreateAPIKeyRequest}
7763
7812
  * @returns A Promise of APIKey
@@ -7794,7 +7843,7 @@ class IamV1Alpha1GenAPI extends API {
7794
7843
  path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`
7795
7844
  }, unmarshalAPIKey);
7796
7845
  /**
7797
- * Remove an API key
7846
+ * Delete an API key
7798
7847
  *
7799
7848
  * @param request - The request {@link DeleteAPIKeyRequest}
7800
7849
  */
@@ -8105,12 +8154,18 @@ const unmarshalDashboard = data => {
8105
8154
  imagesCount: data.images_count,
8106
8155
  ipsCount: data.ips_count,
8107
8156
  ipsUnused: data.ips_unused,
8157
+ placementGroupsCount: data.placement_groups_count,
8158
+ privateNicsCount: data.private_nics_count,
8108
8159
  runningServersCount: data.running_servers_count,
8109
8160
  securityGroupsCount: data.security_groups_count,
8110
8161
  serversByTypes: data.servers_by_types,
8111
8162
  serversCount: data.servers_count,
8112
8163
  snapshotsCount: data.snapshots_count,
8113
- volumesCount: data.volumes_count
8164
+ volumesBSsdCount: data.volumes_b_ssd_count,
8165
+ volumesBSsdTotalSize: data.volumes_b_ssd_total_size,
8166
+ volumesCount: data.volumes_count,
8167
+ volumesLSsdCount: data.volumes_l_ssd_count,
8168
+ volumesLSsdTotalSize: data.volumes_l_ssd_total_size
8114
8169
  };
8115
8170
  };
8116
8171
 
@@ -8264,6 +8319,7 @@ const unmarshalSnapshot$1 = data => {
8264
8319
  return {
8265
8320
  baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined,
8266
8321
  creationDate: unmarshalDate(data.creation_date),
8322
+ errorReason: data.error_reason,
8267
8323
  id: data.id,
8268
8324
  modificationDate: unmarshalDate(data.modification_date),
8269
8325
  name: data.name,
@@ -8392,6 +8448,15 @@ const unmarshalCreateVolumeResponse = data => {
8392
8448
  volume: data.volume ? unmarshalVolume$1(data.volume) : undefined
8393
8449
  };
8394
8450
  };
8451
+ const unmarshalExportSnapshotResponse = data => {
8452
+ if (!isJSONObject(data)) {
8453
+ throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);
8454
+ }
8455
+
8456
+ return {
8457
+ task: data.task ? unmarshalTask(data.task) : undefined
8458
+ };
8459
+ };
8395
8460
  const unmarshalGetBootscriptResponse = data => {
8396
8461
  if (!isJSONObject(data)) {
8397
8462
  throw new TypeError(`Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`);
@@ -9054,7 +9119,10 @@ const marshalCreateServerRequest = (request, defaults) => ({
9054
9119
  }])
9055
9120
  });
9056
9121
  const marshalCreateSnapshotRequest$1 = (request, defaults) => ({
9122
+ bucket: request.bucket,
9123
+ key: request.key,
9057
9124
  name: request.name || randomName('snp'),
9125
+ size: request.size,
9058
9126
  tags: request.tags,
9059
9127
  volume_id: request.volumeId,
9060
9128
  volume_type: request.volumeType,
@@ -9092,6 +9160,10 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
9092
9160
  value: request.baseSnapshot
9093
9161
  }])
9094
9162
  });
9163
+ const marshalExportSnapshotRequest = (request, defaults) => ({
9164
+ bucket: request.bucket,
9165
+ key: request.key
9166
+ });
9095
9167
  const marshalServerActionRequest = (request, defaults) => ({
9096
9168
  action: request.action,
9097
9169
  name: request.name,
@@ -9450,7 +9522,7 @@ class InstanceV1GenAPI extends API {
9450
9522
 
9451
9523
  listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);
9452
9524
  /**
9453
- * Create a snapshot from a given volume
9525
+ * Create a snapshot from a given volume or from a QCOW2 file
9454
9526
  *
9455
9527
  * @param request - The request {@link CreateSnapshotRequest}
9456
9528
  * @returns A Promise of CreateSnapshotResponse
@@ -9489,6 +9561,19 @@ class InstanceV1GenAPI extends API {
9489
9561
  method: 'DELETE',
9490
9562
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
9491
9563
  });
9564
+ /**
9565
+ * Export a snapshot to a given S3 bucket in the same region.
9566
+ *
9567
+ * @param request - The request {@link ExportSnapshotRequest}
9568
+ * @returns A Promise of ExportSnapshotResponse
9569
+ */
9570
+
9571
+ exportSnapshot = request => this.client.fetch({
9572
+ body: JSON.stringify(marshalExportSnapshotRequest(request, this.client.settings)),
9573
+ headers: jsonContentHeaders$a,
9574
+ method: 'POST',
9575
+ path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/export`
9576
+ }, unmarshalExportSnapshotResponse);
9492
9577
  pageOfListVolumes = (request = {}) => this.client.fetch({
9493
9578
  method: 'GET',
9494
9579
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`,
@@ -15948,7 +16033,7 @@ class RdbV1GenAPI extends API {
15948
16033
  urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['start_date', request.startDate])
15949
16034
  }, unmarshalInstanceMetrics);
15950
16035
  /**
15951
- * Create a read replica
16036
+ * You can only create a maximum of 3 read replicas for one instance.
15952
16037
  *
15953
16038
  * @param request - The request {@link CreateReadReplicaRequest}
15954
16039
  * @returns A Promise of ReadReplica
@@ -15983,7 +16068,9 @@ class RdbV1GenAPI extends API {
15983
16068
  path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}`
15984
16069
  }, unmarshalReadReplica);
15985
16070
  /**
15986
- * Reset a read replica
16071
+ * Resetting a read replica resyncs data from the leader node. This operation
16072
+ * can take some time, depending on the database's size. During this
16073
+ * operation, the read replica will not be available. Endpoints will not change.
15987
16074
  *
15988
16075
  * @param request - The request {@link ResetReadReplicaRequest}
15989
16076
  * @returns A Promise of ReadReplica
@@ -15996,7 +16083,7 @@ class RdbV1GenAPI extends API {
15996
16083
  path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/reset`
15997
16084
  }, unmarshalReadReplica);
15998
16085
  /**
15999
- * Create a new endpoint for a given read replica
16086
+ * A read replica can have at most one direct access and one private network endpoint.
16000
16087
  *
16001
16088
  * @param request - The request {@link CreateReadReplicaEndpointRequest}
16002
16089
  * @returns A Promise of ReadReplica
package/dist/index.d.ts CHANGED
@@ -885,7 +885,7 @@ declare type PaginatedContent<K extends string, T = unknown> = PaginatedResponse
885
885
  * @returns A resource Promise with the pagination helpers
886
886
  */
887
887
  declare const enrichForPagination: <K extends string, T extends PaginatedContent<K, unknown>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R) => Promise<T> & {
888
- all: () => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly unknown[] ? unknown : T_1 : never : never)[]>;
888
+ all: () => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
889
889
  [Symbol.asyncIterator]: () => AsyncGenerator<T[K], void, void>;
890
890
  };
891
891
 
@@ -3179,6 +3179,17 @@ interface AvailableDomain {
3179
3179
  available: boolean;
3180
3180
  tld?: Tld;
3181
3181
  }
3182
+ /** Check contacts compatibility response */
3183
+ interface CheckContactsCompatibilityResponse {
3184
+ compatible: boolean;
3185
+ ownerCheckResult?: CheckContactsCompatibilityResponseContactCheckResult;
3186
+ administrativeCheckResult?: CheckContactsCompatibilityResponseContactCheckResult;
3187
+ technicalCheckResult?: CheckContactsCompatibilityResponseContactCheckResult;
3188
+ }
3189
+ interface CheckContactsCompatibilityResponseContactCheckResult {
3190
+ compatible: boolean;
3191
+ errorMessage?: string;
3192
+ }
3182
3193
  /** Clear dns zone records response */
3183
3194
  interface ClearDNSZoneRecordsResponse {
3184
3195
  }
@@ -3960,6 +3971,42 @@ declare type RegistrarApiRegisterExternalDomainRequest = {
3960
3971
  declare type RegistrarApiDeleteExternalDomainRequest = {
3961
3972
  domain: string;
3962
3973
  };
3974
+ declare type RegistrarApiCheckContactsCompatibilityRequest = {
3975
+ /** One-of ('parameter'): at most one of 'domain', 'tld' could be set. */
3976
+ domain?: string;
3977
+ /** One-of ('parameter'): at most one of 'domain', 'tld' could be set. */
3978
+ tld?: string;
3979
+ /**
3980
+ * One-of ('ownerContactType'): at most one of 'ownerContactId',
3981
+ * 'ownerContact' could be set.
3982
+ */
3983
+ ownerContactId?: string;
3984
+ /**
3985
+ * One-of ('ownerContactType'): at most one of 'ownerContactId',
3986
+ * 'ownerContact' could be set.
3987
+ */
3988
+ ownerContact?: NewContact;
3989
+ /**
3990
+ * One-of ('administrativeContactType'): at most one of
3991
+ * 'administrativeContactId', 'administrativeContact' could be set.
3992
+ */
3993
+ administrativeContactId?: string;
3994
+ /**
3995
+ * One-of ('administrativeContactType'): at most one of
3996
+ * 'administrativeContactId', 'administrativeContact' could be set.
3997
+ */
3998
+ administrativeContact?: NewContact;
3999
+ /**
4000
+ * One-of ('technicalContactType'): at most one of 'technicalContactId',
4001
+ * 'technicalContact' could be set.
4002
+ */
4003
+ technicalContactId?: string;
4004
+ /**
4005
+ * One-of ('technicalContactType'): at most one of 'technicalContactId',
4006
+ * 'technicalContact' could be set.
4007
+ */
4008
+ technicalContact?: NewContact;
4009
+ };
3963
4010
  declare type RegistrarApiListContactsRequest = {
3964
4011
  page?: number;
3965
4012
  pageSize?: number;
@@ -4354,6 +4401,14 @@ declare class DomainRegistrarV2Beta1GenAPI extends API {
4354
4401
  * @returns A Promise of DeleteExternalDomainResponse
4355
4402
  */
4356
4403
  deleteExternalDomain: (request: Readonly<RegistrarApiDeleteExternalDomainRequest>) => Promise<DeleteExternalDomainResponse>;
4404
+ /**
4405
+ * Check if contacts are compatible against a domain or a tld. If not, it will
4406
+ * return the information requiring a correction.
4407
+ *
4408
+ * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
4409
+ * @returns A Promise of CheckContactsCompatibilityResponse
4410
+ */
4411
+ checkContactsCompatibility: (request?: Readonly<RegistrarApiCheckContactsCompatibilityRequest>) => Promise<CheckContactsCompatibilityResponse>;
4357
4412
  protected pageOfListContacts: (request?: Readonly<RegistrarApiListContactsRequest>) => Promise<ListContactsResponse>;
4358
4413
  /**
4359
4414
  * Return a list of contacts with their domains and roles. You can filter the
@@ -4528,6 +4583,8 @@ type index$v_RenewableDomainStatus = RenewableDomainStatus;
4528
4583
  type index$v_SSLCertificateStatus = SSLCertificateStatus;
4529
4584
  type index$v_TaskType = TaskType;
4530
4585
  type index$v_AvailableDomain = AvailableDomain;
4586
+ type index$v_CheckContactsCompatibilityResponse = CheckContactsCompatibilityResponse;
4587
+ type index$v_CheckContactsCompatibilityResponseContactCheckResult = CheckContactsCompatibilityResponseContactCheckResult;
4531
4588
  type index$v_ClearDNSZoneRecordsResponse = ClearDNSZoneRecordsResponse;
4532
4589
  type index$v_Contact = Contact;
4533
4590
  type index$v_ContactExtensionEU = ContactExtensionEU;
@@ -4631,6 +4688,7 @@ type index$v_RegistrarApiTransferInDomainRequest = RegistrarApiTransferInDomainR
4631
4688
  type index$v_RegistrarApiTradeDomainRequest = RegistrarApiTradeDomainRequest;
4632
4689
  type index$v_RegistrarApiRegisterExternalDomainRequest = RegistrarApiRegisterExternalDomainRequest;
4633
4690
  type index$v_RegistrarApiDeleteExternalDomainRequest = RegistrarApiDeleteExternalDomainRequest;
4691
+ type index$v_RegistrarApiCheckContactsCompatibilityRequest = RegistrarApiCheckContactsCompatibilityRequest;
4634
4692
  type index$v_RegistrarApiListContactsRequest = RegistrarApiListContactsRequest;
4635
4693
  type index$v_RegistrarApiGetContactRequest = RegistrarApiGetContactRequest;
4636
4694
  type index$v_RegistrarApiUpdateContactRequest = RegistrarApiUpdateContactRequest;
@@ -4674,6 +4732,8 @@ declare namespace index$v {
4674
4732
  TaskStatus$1 as TaskStatus,
4675
4733
  index$v_TaskType as TaskType,
4676
4734
  index$v_AvailableDomain as AvailableDomain,
4735
+ index$v_CheckContactsCompatibilityResponse as CheckContactsCompatibilityResponse,
4736
+ index$v_CheckContactsCompatibilityResponseContactCheckResult as CheckContactsCompatibilityResponseContactCheckResult,
4677
4737
  index$v_ClearDNSZoneRecordsResponse as ClearDNSZoneRecordsResponse,
4678
4738
  index$v_Contact as Contact,
4679
4739
  index$v_ContactExtensionEU as ContactExtensionEU,
@@ -4780,6 +4840,7 @@ declare namespace index$v {
4780
4840
  index$v_RegistrarApiTradeDomainRequest as RegistrarApiTradeDomainRequest,
4781
4841
  index$v_RegistrarApiRegisterExternalDomainRequest as RegistrarApiRegisterExternalDomainRequest,
4782
4842
  index$v_RegistrarApiDeleteExternalDomainRequest as RegistrarApiDeleteExternalDomainRequest,
4843
+ index$v_RegistrarApiCheckContactsCompatibilityRequest as RegistrarApiCheckContactsCompatibilityRequest,
4783
4844
  index$v_RegistrarApiListContactsRequest as RegistrarApiListContactsRequest,
4784
4845
  index$v_RegistrarApiGetContactRequest as RegistrarApiGetContactRequest,
4785
4846
  index$v_RegistrarApiUpdateContactRequest as RegistrarApiUpdateContactRequest,
@@ -5159,7 +5220,7 @@ declare type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc';
5159
5220
  declare type LogStream = 'unknown' | 'stdout' | 'stderr';
5160
5221
  declare type NamespaceStatus$1 = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending';
5161
5222
  declare type NullValue$1 = 'NULL_VALUE';
5162
- declare type RuntimeStatus = 'unknown_status' | 'beta' | 'available' | 'deprecated';
5223
+ declare type RuntimeStatus = 'unknown_status' | 'beta' | 'available' | 'deprecated' | 'end_of_support' | 'end_of_life';
5163
5224
  declare type TokenStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'creating';
5164
5225
  /** Cron */
5165
5226
  interface Cron {
@@ -6248,7 +6309,7 @@ declare type ListSSHKeysRequest = {
6248
6309
  };
6249
6310
  declare type CreateSSHKeyRequest = {
6250
6311
  /** The name of the SSH key. Max length is 1000 */
6251
- name: string;
6312
+ name?: string;
6252
6313
  /**
6253
6314
  * SSH public key. Currently ssh-rsa, ssh-dss (DSA), ssh-ed25519 and ecdsa
6254
6315
  * keys with NIST curves are supported. Max length is 65000
@@ -6305,7 +6366,7 @@ declare type ListApplicationsRequest = {
6305
6366
  };
6306
6367
  declare type CreateApplicationRequest = {
6307
6368
  /** Name of application to create (max length is 64 chars) */
6308
- name: string;
6369
+ name?: string;
6309
6370
  /** ID of organization */
6310
6371
  organizationId?: string;
6311
6372
  /** Description of application (max length is 200 chars) */
@@ -6352,7 +6413,7 @@ declare type CreateGroupRequest = {
6352
6413
  * Name of the group to create (max length is 64 chars). MUST be unique inside
6353
6414
  * an organization
6354
6415
  */
6355
- name: string;
6416
+ name?: string;
6356
6417
  /** Description of the group to create (max length is 200 chars) */
6357
6418
  description: string;
6358
6419
  };
@@ -6436,7 +6497,7 @@ declare type ListPoliciesRequest = {
6436
6497
  };
6437
6498
  declare type CreatePolicyRequest = {
6438
6499
  /** Name of policy to create (max length is 64 chars) */
6439
- name: string;
6500
+ name?: string;
6440
6501
  /** Description of policy to create (max length is 200 chars) */
6441
6502
  description: string;
6442
6503
  /** ID of organization */
@@ -6615,7 +6676,7 @@ declare class IamV1Alpha1GenAPI extends API {
6615
6676
  [Symbol.asyncIterator]: () => AsyncGenerator<SSHKey[], void, void>;
6616
6677
  };
6617
6678
  /**
6618
- * Add an SSH key
6679
+ * Create an SSH key
6619
6680
  *
6620
6681
  * @param request - The request {@link CreateSSHKeyRequest}
6621
6682
  * @returns A Promise of SSHKey
@@ -6636,7 +6697,7 @@ declare class IamV1Alpha1GenAPI extends API {
6636
6697
  */
6637
6698
  updateSSHKey: (request: Readonly<UpdateSSHKeyRequest>) => Promise<SSHKey>;
6638
6699
  /**
6639
- * Remove an SSH key
6700
+ * Delete an SSH key
6640
6701
  *
6641
6702
  * @param request - The request {@link DeleteSSHKeyRequest}
6642
6703
  */
@@ -6709,7 +6770,7 @@ declare class IamV1Alpha1GenAPI extends API {
6709
6770
  [Symbol.asyncIterator]: () => AsyncGenerator<Group[], void, void>;
6710
6771
  };
6711
6772
  /**
6712
- * Add a new group
6773
+ * Create a new group
6713
6774
  *
6714
6775
  * @param request - The request {@link CreateGroupRequest}
6715
6776
  * @returns A Promise of Group
@@ -6835,7 +6896,7 @@ declare class IamV1Alpha1GenAPI extends API {
6835
6896
  [Symbol.asyncIterator]: () => AsyncGenerator<APIKey[], void, void>;
6836
6897
  };
6837
6898
  /**
6838
- * Add an API key
6899
+ * Create an API key
6839
6900
  *
6840
6901
  * @param request - The request {@link CreateAPIKeyRequest}
6841
6902
  * @returns A Promise of APIKey
@@ -6856,7 +6917,7 @@ declare class IamV1Alpha1GenAPI extends API {
6856
6917
  */
6857
6918
  updateAPIKey: (request: Readonly<UpdateAPIKeyRequest>) => Promise<APIKey>;
6858
6919
  /**
6859
- * Remove an API key
6920
+ * Delete an API key
6860
6921
  *
6861
6922
  * @param request - The request {@link DeleteAPIKeyRequest}
6862
6923
  */
@@ -7086,6 +7147,15 @@ interface Dashboard {
7086
7147
  ipsCount: number;
7087
7148
  securityGroupsCount: number;
7088
7149
  ipsUnused: number;
7150
+ volumesLSsdCount: number;
7151
+ volumesBSsdCount: number;
7152
+ volumesLSsdTotalSize: number;
7153
+ volumesBSsdTotalSize: number;
7154
+ privateNicsCount: number;
7155
+ placementGroupsCount: number;
7156
+ }
7157
+ interface ExportSnapshotResponse {
7158
+ task?: Task;
7089
7159
  }
7090
7160
  interface GetBootscriptResponse {
7091
7161
  bootscript?: Bootscript;
@@ -7573,6 +7643,8 @@ interface Snapshot$1 {
7573
7643
  modificationDate?: Date;
7574
7644
  /** The snapshot zone */
7575
7645
  zone: Zone;
7646
+ /** The reason for the failed snapshot import */
7647
+ errorReason?: string;
7576
7648
  }
7577
7649
  /** Snapshot. base volume */
7578
7650
  interface SnapshotBaseVolume {
@@ -7909,6 +7981,12 @@ declare type CreateSnapshotRequest$1 = {
7909
7981
  * the original volume will be used.
7910
7982
  */
7911
7983
  volumeType: SnapshotVolumeType;
7984
+ /** Bucket name for snapshot imports */
7985
+ bucket?: string;
7986
+ /** Object key for snapshot imports */
7987
+ key?: string;
7988
+ /** Imported snapshot size, must be a multiple of 512 */
7989
+ size?: number;
7912
7990
  };
7913
7991
  declare type GetSnapshotRequest$1 = {
7914
7992
  /** Zone to target. If none is passed will use default zone from the config */
@@ -7922,6 +8000,16 @@ declare type DeleteSnapshotRequest$1 = {
7922
8000
  /** UUID of the snapshot you want to delete */
7923
8001
  snapshotId: string;
7924
8002
  };
8003
+ declare type ExportSnapshotRequest = {
8004
+ /** Zone to target. If none is passed will use default zone from the config */
8005
+ zone?: Zone;
8006
+ /** The snapshot ID */
8007
+ snapshotId: string;
8008
+ /** S3 bucket name */
8009
+ bucket: string;
8010
+ /** S3 object key */
8011
+ key: string;
8012
+ };
7925
8013
  declare type ListVolumesRequest = {
7926
8014
  /** Zone to target. If none is passed will use default zone from the config */
7927
8015
  zone?: Zone;
@@ -8698,7 +8786,7 @@ declare class InstanceV1GenAPI extends API {
8698
8786
  [Symbol.asyncIterator]: () => AsyncGenerator<Snapshot$1[], void, void>;
8699
8787
  };
8700
8788
  /**
8701
- * Create a snapshot from a given volume
8789
+ * Create a snapshot from a given volume or from a QCOW2 file
8702
8790
  *
8703
8791
  * @param request - The request {@link CreateSnapshotRequest}
8704
8792
  * @returns A Promise of CreateSnapshotResponse
@@ -8718,6 +8806,13 @@ declare class InstanceV1GenAPI extends API {
8718
8806
  * @param request - The request {@link DeleteSnapshotRequest}
8719
8807
  */
8720
8808
  deleteSnapshot: (request: Readonly<DeleteSnapshotRequest$1>) => Promise<void>;
8809
+ /**
8810
+ * Export a snapshot to a given S3 bucket in the same region.
8811
+ *
8812
+ * @param request - The request {@link ExportSnapshotRequest}
8813
+ * @returns A Promise of ExportSnapshotResponse
8814
+ */
8815
+ exportSnapshot: (request: Readonly<ExportSnapshotRequest>) => Promise<ExportSnapshotResponse>;
8721
8816
  protected pageOfListVolumes: (request?: Readonly<ListVolumesRequest>) => Promise<ListVolumesResponse>;
8722
8817
  /**
8723
8818
  * List volumes
@@ -9218,6 +9313,7 @@ type index$n_CreateServerResponse = CreateServerResponse;
9218
9313
  type index$n_CreateSnapshotResponse = CreateSnapshotResponse;
9219
9314
  type index$n_CreateVolumeResponse = CreateVolumeResponse;
9220
9315
  type index$n_Dashboard = Dashboard;
9316
+ type index$n_ExportSnapshotResponse = ExportSnapshotResponse;
9221
9317
  type index$n_GetBootscriptResponse = GetBootscriptResponse;
9222
9318
  type index$n_GetDashboardResponse = GetDashboardResponse;
9223
9319
  type index$n_GetIpResponse = GetIpResponse;
@@ -9291,6 +9387,7 @@ type index$n_ServerActionRequest = ServerActionRequest;
9291
9387
  type index$n_ListServerUserDataRequest = ListServerUserDataRequest;
9292
9388
  type index$n_DeleteServerUserDataRequest = DeleteServerUserDataRequest;
9293
9389
  type index$n_CreateImageRequest = CreateImageRequest;
9390
+ type index$n_ExportSnapshotRequest = ExportSnapshotRequest;
9294
9391
  type index$n_ListVolumesRequest = ListVolumesRequest;
9295
9392
  type index$n_CreateVolumeRequest = CreateVolumeRequest;
9296
9393
  type index$n_GetVolumeRequest = GetVolumeRequest;
@@ -9379,6 +9476,7 @@ declare namespace index$n {
9379
9476
  index$n_CreateSnapshotResponse as CreateSnapshotResponse,
9380
9477
  index$n_CreateVolumeResponse as CreateVolumeResponse,
9381
9478
  index$n_Dashboard as Dashboard,
9479
+ index$n_ExportSnapshotResponse as ExportSnapshotResponse,
9382
9480
  index$n_GetBootscriptResponse as GetBootscriptResponse,
9383
9481
  index$n_GetDashboardResponse as GetDashboardResponse,
9384
9482
  GetImageResponse$1 as GetImageResponse,
@@ -9468,6 +9566,7 @@ declare namespace index$n {
9468
9566
  CreateSnapshotRequest$1 as CreateSnapshotRequest,
9469
9567
  GetSnapshotRequest$1 as GetSnapshotRequest,
9470
9568
  DeleteSnapshotRequest$1 as DeleteSnapshotRequest,
9569
+ index$n_ExportSnapshotRequest as ExportSnapshotRequest,
9471
9570
  index$n_ListVolumesRequest as ListVolumesRequest,
9472
9571
  index$n_CreateVolumeRequest as CreateVolumeRequest,
9473
9572
  index$n_GetVolumeRequest as GetVolumeRequest,
@@ -11021,7 +11120,12 @@ interface CreateClusterRequestOpenIDConnectConfig {
11021
11120
  interface CreateClusterRequestPoolConfig {
11022
11121
  /** The name of the pool */
11023
11122
  name: string;
11024
- /** The node type is the type of Scaleway Instance wanted for the pool */
11123
+ /**
11124
+ * The node type is the type of Scaleway Instance wanted for the pool. Nodes
11125
+ * with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST).
11126
+ * 'external' is a special node type used to provision instances from other
11127
+ * cloud providers.
11128
+ */
11025
11129
  nodeType: string;
11026
11130
  /** The placement group ID in which all the nodes of the pool will be created */
11027
11131
  placementGroupId?: string;
@@ -11030,12 +11134,12 @@ interface CreateClusterRequestPoolConfig {
11030
11134
  /** The size (number of nodes) of the pool */
11031
11135
  size: number;
11032
11136
  /**
11033
- * The minimun size of the pool. Note that this fields will be used only when
11137
+ * The minimum size of the pool. Note that this field will be used only when
11034
11138
  * autoscaling is enabled.
11035
11139
  */
11036
11140
  minSize?: number;
11037
11141
  /**
11038
- * The maximum size of the pool. Note that this fields will be used only when
11142
+ * The maximum size of the pool. Note that this field will be used only when
11039
11143
  * autoscaling is enabled.
11040
11144
  */
11041
11145
  maxSize?: number;
@@ -11170,19 +11274,24 @@ interface Pool {
11170
11274
  status: PoolStatus;
11171
11275
  /** The version of the pool */
11172
11276
  version: string;
11173
- /** The node type is the type of Scaleway Instance wanted for the pool */
11277
+ /**
11278
+ * The node type is the type of Scaleway Instance wanted for the pool. Nodes
11279
+ * with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST).
11280
+ * 'external' is a special node type used to provision instances from other
11281
+ * cloud providers.
11282
+ */
11174
11283
  nodeType: string;
11175
11284
  /** The enablement of the autoscaling feature for the pool */
11176
11285
  autoscaling: boolean;
11177
11286
  /** The size (number of nodes) of the pool */
11178
11287
  size: number;
11179
11288
  /**
11180
- * The minimun size of the pool. Note that this fields will be used only when
11289
+ * The minimum size of the pool. Note that this field will be used only when
11181
11290
  * autoscaling is enabled.
11182
11291
  */
11183
11292
  minSize: number;
11184
11293
  /**
11185
- * The maximum size of the pool. Note that this fields will be used only when
11294
+ * The maximum size of the pool. Note that this field will be used only when
11186
11295
  * autoscaling is enabled.
11187
11296
  */
11188
11297
  maxSize: number;
@@ -11322,8 +11431,8 @@ interface Version$1 {
11322
11431
  region: Region;
11323
11432
  /** The supported Container Network Interface (CNI) plugins for this version */
11324
11433
  availableCnis: Array<CNI>;
11325
- /** The supported Ingress Controllers for this version */
11326
- availableIngresses: Array<Ingress>;
11434
+ /** @deprecated The supported Ingress Controllers for this version */
11435
+ availableIngresses?: Array<Ingress>;
11327
11436
  /** The supported container runtimes for this version */
11328
11437
  availableContainerRuntimes: Array<Runtime>;
11329
11438
  /** The supported feature gates for this version */
@@ -11523,7 +11632,12 @@ declare type CreatePoolRequest = {
11523
11632
  clusterId: string;
11524
11633
  /** The name of the pool */
11525
11634
  name?: string;
11526
- /** The node type is the type of Scaleway Instance wanted for the pool */
11635
+ /**
11636
+ * The node type is the type of Scaleway Instance wanted for the pool. Nodes
11637
+ * with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST).
11638
+ * 'external' is a special node type used to provision instances from other
11639
+ * cloud providers.
11640
+ */
11527
11641
  nodeType: string;
11528
11642
  /** The placement group ID in which all the nodes of the pool will be created */
11529
11643
  placementGroupId?: string;
@@ -11532,12 +11646,12 @@ declare type CreatePoolRequest = {
11532
11646
  /** The size (number of nodes) of the pool */
11533
11647
  size: number;
11534
11648
  /**
11535
- * The minimun size of the pool. Note that this fields will be used only when
11649
+ * The minimum size of the pool. Note that this field will be used only when
11536
11650
  * autoscaling is enabled.
11537
11651
  */
11538
11652
  minSize?: number;
11539
11653
  /**
11540
- * The maximum size of the pool. Note that this fields will be used only when
11654
+ * The maximum size of the pool. Note that this field will be used only when
11541
11655
  * autoscaling is enabled.
11542
11656
  */
11543
11657
  maxSize?: number;
@@ -16828,7 +16942,7 @@ declare type CreateEndpointRequest = {
16828
16942
  declare type DeleteEndpointRequest$1 = {
16829
16943
  /** Region to target. If none is passed will use default region from the config */
16830
16944
  region?: Region;
16831
- /** UUID of the endpoint you want to delete */
16945
+ /** This endpoint can also be used to delete a read replica endpoint. */
16832
16946
  endpointId: string;
16833
16947
  };
16834
16948
  declare type GetEndpointRequest$1 = {
@@ -17015,7 +17129,7 @@ declare class RdbV1GenAPI extends API {
17015
17129
  */
17016
17130
  getInstanceMetrics: (request: Readonly<GetInstanceMetricsRequest>) => Promise<InstanceMetrics>;
17017
17131
  /**
17018
- * Create a read replica
17132
+ * You can only create a maximum of 3 read replicas for one instance.
17019
17133
  *
17020
17134
  * @param request - The request {@link CreateReadReplicaRequest}
17021
17135
  * @returns A Promise of ReadReplica
@@ -17036,14 +17150,16 @@ declare class RdbV1GenAPI extends API {
17036
17150
  */
17037
17151
  deleteReadReplica: (request: Readonly<DeleteReadReplicaRequest>) => Promise<ReadReplica>;
17038
17152
  /**
17039
- * Reset a read replica
17153
+ * Resetting a read replica resyncs data from the leader node. This operation
17154
+ * can take some time, depending on the database's size. During this
17155
+ * operation, the read replica will not be available. Endpoints will not change.
17040
17156
  *
17041
17157
  * @param request - The request {@link ResetReadReplicaRequest}
17042
17158
  * @returns A Promise of ReadReplica
17043
17159
  */
17044
17160
  resetReadReplica: (request: Readonly<ResetReadReplicaRequest>) => Promise<ReadReplica>;
17045
17161
  /**
17046
- * Create a new endpoint for a given read replica
17162
+ * A read replica can have at most one direct access and one private network endpoint.
17047
17163
  *
17048
17164
  * @param request - The request {@link CreateReadReplicaEndpointRequest}
17049
17165
  * @returns A Promise of ReadReplica
@@ -1,4 +1,4 @@
1
- const version = 'v0.1.0-beta.4';
1
+ const version = 'v0.1.0-beta.7';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
@@ -11,30 +11,13 @@ import { ScalewayError } from '../scw-error.js';
11
11
  */
12
12
 
13
13
  const buildMessage = (precondition, helpMessage) => {
14
- let message;
15
-
16
- switch (precondition) {
17
- case 'unknown_precondition':
18
- message = 'unknown precondition';
19
- break;
20
-
21
- case 'resource_still_in_use':
22
- message = 'resource is still in use';
23
- break;
24
-
25
- case 'attribute_must_be_set':
26
- message = 'attribute must be set';
27
- break;
28
-
29
- default:
30
- message = '';
31
- }
14
+ let message = `precondition failed: ${precondition}`;
32
15
 
33
16
  if (typeof helpMessage === 'string' && helpMessage.length > 0) {
34
17
  message = message.concat(', ', helpMessage);
35
18
  }
36
19
 
37
- return `precondition failed: ${message}`;
20
+ return message;
38
21
  };
39
22
  /**
40
23
  * PreconditionFailed error is used when a precondition is not respected.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.8",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -36,5 +36,5 @@
36
36
  "bundledDependencies": [
37
37
  "@scaleway/random-name"
38
38
  ],
39
- "gitHead": "d0dccb15478b4b9580c5696920fc210b3ab18e98"
39
+ "gitHead": "7663ed4b82f5a60a646ed4826edb0a297cd34386"
40
40
  }