@scaleway/sdk-baremetal 1.3.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +37 -65
- package/dist/v1/content.gen.js +4 -1
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +8 -30
- package/dist/v1/types.gen.d.ts +2 -2
- package/dist/v3/api.gen.d.ts +1 -1
- package/dist/v3/api.gen.js +10 -21
- package/dist/v3/content.gen.js +4 -1
- package/dist/v3/index.gen.d.ts +1 -1
- package/dist/v3/marshalling.gen.js +2 -8
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -6
- package/dist/v1/api.gen.cjs +0 -600
- package/dist/v1/content.gen.cjs +0 -19
- package/dist/v1/index.gen.cjs +0 -43
- package/dist/v1/marshalling.gen.cjs +0 -731
- package/dist/v1/validation-rules.gen.cjs +0 -116
- package/dist/v3/api.gen.cjs +0 -104
- package/dist/v3/content.gen.cjs +0 -4
- package/dist/v3/index.gen.cjs +0 -12
- package/dist/v3/marshalling.gen.cjs +0 -60
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-baremetal
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-baremetal)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-baremetal)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Baremetal API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-baremetal @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-baremetal @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-baremetal @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Baremetal } from '@scaleway/sdk-baremetal'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Baremetal.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Baremetal } from '@scaleway/sdk-baremetal'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Baremetal.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Baremetal API Documentation](https://www.scaleway.com/en/developers/api/baremetal/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, DeleteOptionServerRequest, DeleteServerRequest, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOfferRequest, GetOptionRequest, GetOSRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, InstallServerRequest, IP, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListOSRequest, ListOSResponse, ListServerEventsRequest, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListSettingsRequest, ListSettingsResponse, MigrateServerToMonthlyOfferRequest, Offer, Option, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Elastic Metal API.
|
|
6
6
|
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -29,10 +29,7 @@ class API extends API$1 {
|
|
|
29
29
|
["order_by", request.orderBy],
|
|
30
30
|
["organization_id", request.organizationId],
|
|
31
31
|
["page", request.page],
|
|
32
|
-
[
|
|
33
|
-
"page_size",
|
|
34
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
35
|
-
],
|
|
32
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
36
33
|
["project_id", request.projectId],
|
|
37
34
|
["status", request.status],
|
|
38
35
|
["tags", request.tags]
|
|
@@ -68,9 +65,7 @@ class API extends API$1 {
|
|
|
68
65
|
* @returns A Promise of Server
|
|
69
66
|
*/
|
|
70
67
|
waitForServer = (request, options) => waitForResource(
|
|
71
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
72
|
-
!SERVER_TRANSIENT_STATUSES.includes(res.status)
|
|
73
|
-
)),
|
|
68
|
+
options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))),
|
|
74
69
|
this.getServer,
|
|
75
70
|
request,
|
|
76
71
|
options
|
|
@@ -208,10 +203,7 @@ class API extends API$1 {
|
|
|
208
203
|
urlParams: urlParams(
|
|
209
204
|
["order_by", request.orderBy],
|
|
210
205
|
["page", request.page],
|
|
211
|
-
[
|
|
212
|
-
"page_size",
|
|
213
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
214
|
-
]
|
|
206
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
215
207
|
)
|
|
216
208
|
},
|
|
217
209
|
unmarshalListServerEventsResponse
|
|
@@ -245,14 +237,16 @@ class API extends API$1 {
|
|
|
245
237
|
*
|
|
246
238
|
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
247
239
|
*/
|
|
248
|
-
validatePartitioningSchema = (request) => this.client.fetch(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
240
|
+
validatePartitioningSchema = (request) => this.client.fetch(
|
|
241
|
+
{
|
|
242
|
+
body: JSON.stringify(
|
|
243
|
+
marshalValidatePartitioningSchemaRequest(request, this.client.settings)
|
|
244
|
+
),
|
|
245
|
+
headers: jsonContentHeaders,
|
|
246
|
+
method: "POST",
|
|
247
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
248
|
+
}
|
|
249
|
+
);
|
|
256
250
|
/**
|
|
257
251
|
* Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
|
|
258
252
|
The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
|
|
@@ -291,10 +285,12 @@ class API extends API$1 {
|
|
|
291
285
|
*
|
|
292
286
|
* @param request - The request {@link StopBMCAccessRequest}
|
|
293
287
|
*/
|
|
294
|
-
stopBMCAccess = (request) => this.client.fetch(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
288
|
+
stopBMCAccess = (request) => this.client.fetch(
|
|
289
|
+
{
|
|
290
|
+
method: "DELETE",
|
|
291
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
292
|
+
}
|
|
293
|
+
);
|
|
298
294
|
/**
|
|
299
295
|
* Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
|
|
300
296
|
*
|
|
@@ -362,10 +358,7 @@ class API extends API$1 {
|
|
|
362
358
|
urlParams: urlParams(
|
|
363
359
|
["name", request.name],
|
|
364
360
|
["page", request.page],
|
|
365
|
-
[
|
|
366
|
-
"page_size",
|
|
367
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
368
|
-
],
|
|
361
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
369
362
|
["subscription_period", request.subscriptionPeriod]
|
|
370
363
|
)
|
|
371
364
|
},
|
|
@@ -412,10 +405,7 @@ class API extends API$1 {
|
|
|
412
405
|
["name", request.name],
|
|
413
406
|
["offer_id", request.offerId],
|
|
414
407
|
["page", request.page],
|
|
415
|
-
[
|
|
416
|
-
"page_size",
|
|
417
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
418
|
-
]
|
|
408
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
419
409
|
)
|
|
420
410
|
},
|
|
421
411
|
unmarshalListOptionsResponse
|
|
@@ -434,14 +424,8 @@ class API extends API$1 {
|
|
|
434
424
|
urlParams: urlParams(
|
|
435
425
|
["order_by", request.orderBy],
|
|
436
426
|
["page", request.page],
|
|
437
|
-
[
|
|
438
|
-
|
|
439
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
440
|
-
],
|
|
441
|
-
[
|
|
442
|
-
"project_id",
|
|
443
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
444
|
-
]
|
|
427
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
428
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
445
429
|
)
|
|
446
430
|
},
|
|
447
431
|
unmarshalListSettingsResponse
|
|
@@ -477,10 +461,7 @@ class API extends API$1 {
|
|
|
477
461
|
urlParams: urlParams(
|
|
478
462
|
["offer_id", request.offerId],
|
|
479
463
|
["page", request.page],
|
|
480
|
-
[
|
|
481
|
-
"page_size",
|
|
482
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
483
|
-
]
|
|
464
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
484
465
|
)
|
|
485
466
|
},
|
|
486
467
|
unmarshalListOSResponse
|
|
@@ -512,7 +493,9 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
512
493
|
* type ∈ {'zone','region','global','unspecified'}
|
|
513
494
|
*/
|
|
514
495
|
static LOCALITY = toApiLocality({
|
|
515
|
-
zones: [
|
|
496
|
+
zones: [
|
|
497
|
+
"fr-par-2"
|
|
498
|
+
]
|
|
516
499
|
});
|
|
517
500
|
/**
|
|
518
501
|
* Add a server to a Private Network.
|
|
@@ -523,10 +506,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
523
506
|
addServerPrivateNetwork = (request) => this.client.fetch(
|
|
524
507
|
{
|
|
525
508
|
body: JSON.stringify(
|
|
526
|
-
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
|
|
527
|
-
request,
|
|
528
|
-
this.client.settings
|
|
529
|
-
)
|
|
509
|
+
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)
|
|
530
510
|
),
|
|
531
511
|
headers: jsonContentHeaders,
|
|
532
512
|
method: "POST",
|
|
@@ -543,10 +523,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
543
523
|
setServerPrivateNetworks = (request) => this.client.fetch(
|
|
544
524
|
{
|
|
545
525
|
body: JSON.stringify(
|
|
546
|
-
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
|
|
547
|
-
request,
|
|
548
|
-
this.client.settings
|
|
549
|
-
)
|
|
526
|
+
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)
|
|
550
527
|
),
|
|
551
528
|
headers: jsonContentHeaders,
|
|
552
529
|
method: "PUT",
|
|
@@ -562,10 +539,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
562
539
|
["order_by", request.orderBy],
|
|
563
540
|
["organization_id", request.organizationId],
|
|
564
541
|
["page", request.page],
|
|
565
|
-
[
|
|
566
|
-
"page_size",
|
|
567
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
568
|
-
],
|
|
542
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
569
543
|
["private_network_id", request.privateNetworkId],
|
|
570
544
|
["project_id", request.projectId],
|
|
571
545
|
["server_id", request.serverId]
|
|
@@ -579,20 +553,18 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
579
553
|
* @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
|
|
580
554
|
* @returns A Promise of ListServerPrivateNetworksResponse
|
|
581
555
|
*/
|
|
582
|
-
listServerPrivateNetworks = (request = {}) => enrichForPagination(
|
|
583
|
-
"serverPrivateNetworks",
|
|
584
|
-
this.pageOfListServerPrivateNetworks,
|
|
585
|
-
request
|
|
586
|
-
);
|
|
556
|
+
listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
|
|
587
557
|
/**
|
|
588
558
|
* Delete a Private Network.
|
|
589
559
|
*
|
|
590
560
|
* @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
|
|
591
561
|
*/
|
|
592
|
-
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
562
|
+
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
563
|
+
{
|
|
564
|
+
method: "DELETE",
|
|
565
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
566
|
+
}
|
|
567
|
+
);
|
|
596
568
|
}
|
|
597
569
|
export {
|
|
598
570
|
API,
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -2,7 +2,10 @@ const SERVER_INSTALL_TRANSIENT_STATUSES = [
|
|
|
2
2
|
"to_install",
|
|
3
3
|
"installing"
|
|
4
4
|
];
|
|
5
|
-
const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [
|
|
5
|
+
const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [
|
|
6
|
+
"attaching",
|
|
7
|
+
"detaching"
|
|
8
|
+
];
|
|
6
9
|
const SERVER_TRANSIENT_STATUSES = [
|
|
7
10
|
"delivering",
|
|
8
11
|
"stopping",
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { API, PrivateNetworkAPI, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { AddOptionServerRequest, BMCAccess,
|
|
4
|
+
export type { AddOptionServerRequest, BMCAccess, CertificationOption, CPU, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOfferRequest, GetOptionRequest, GetOSRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, GPU, InstallServerRequest, IP, IPReverseStatus, IPVersion, LicenseOption, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListOSRequest, ListOSResponse, ListServerEventsRequest, ListServerEventsRequestOrderBy, ListServerEventsResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListSettingsRequest, ListSettingsRequestOrderBy, ListSettingsResponse, Memory, MigrateServerToMonthlyOfferRequest, Offer, OfferOptionOffer, OfferStock, OfferSubscriptionPeriod, Option, OS, OSOSField, PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, PrivateNetworkOption, PublicBandwidthOption, RaidController, RebootServerRequest, RemoteAccessOption, Schema, SchemaDisk, SchemaFilesystem, SchemaFilesystemFormat, SchemaPartition, SchemaPartitionLabel, SchemaPool, SchemaPoolType, SchemaRAID, SchemaRAIDLevel, SchemaZFS, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse,
|
|
2
|
+
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse, InstallServerRequest, IP, ListOffersResponse, ListOptionsResponse, ListOSResponse, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListSettingsResponse, Offer, Option, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalSchema: (data: unknown) => Schema;
|
|
4
4
|
export declare const unmarshalIP: (data: unknown) => IP;
|
|
5
5
|
export declare const unmarshalServer: (data: unknown) => Server;
|
|
@@ -34,10 +34,7 @@ const unmarshalSchemaDisk = (data) => {
|
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
device: data.device,
|
|
37
|
-
partitions: unmarshalArrayOfObject(
|
|
38
|
-
data.partitions,
|
|
39
|
-
unmarshalSchemaPartition
|
|
40
|
-
)
|
|
37
|
+
partitions: unmarshalArrayOfObject(data.partitions, unmarshalSchemaPartition)
|
|
41
38
|
};
|
|
42
39
|
};
|
|
43
40
|
const unmarshalSchemaFilesystem = (data) => {
|
|
@@ -82,10 +79,7 @@ const unmarshalSchema = (data) => {
|
|
|
82
79
|
}
|
|
83
80
|
return {
|
|
84
81
|
disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
|
|
85
|
-
filesystems: unmarshalArrayOfObject(
|
|
86
|
-
data.filesystems,
|
|
87
|
-
unmarshalSchemaFilesystem
|
|
88
|
-
),
|
|
82
|
+
filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalSchemaFilesystem),
|
|
89
83
|
raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
90
84
|
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
91
85
|
};
|
|
@@ -380,18 +374,12 @@ const unmarshalOffer = (data) => {
|
|
|
380
374
|
name: data.name,
|
|
381
375
|
operationPath: data.operation_path,
|
|
382
376
|
options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
|
|
383
|
-
persistentMemories: unmarshalArrayOfObject(
|
|
384
|
-
data.persistent_memories,
|
|
385
|
-
unmarshalPersistentMemory
|
|
386
|
-
),
|
|
377
|
+
persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory),
|
|
387
378
|
pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : void 0,
|
|
388
379
|
pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : void 0,
|
|
389
380
|
privateBandwidth: data.private_bandwidth,
|
|
390
381
|
quotaName: data.quota_name,
|
|
391
|
-
raidControllers: unmarshalArrayOfObject(
|
|
392
|
-
data.raid_controllers,
|
|
393
|
-
unmarshalRaidController
|
|
394
|
-
),
|
|
382
|
+
raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController),
|
|
395
383
|
sharedBandwidth: data.shared_bandwidth,
|
|
396
384
|
stock: data.stock,
|
|
397
385
|
subscriptionPeriod: data.subscription_period,
|
|
@@ -533,10 +521,7 @@ const unmarshalListServerPrivateNetworksResponse = (data) => {
|
|
|
533
521
|
);
|
|
534
522
|
}
|
|
535
523
|
return {
|
|
536
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
537
|
-
data.server_private_networks,
|
|
538
|
-
unmarshalServerPrivateNetwork
|
|
539
|
-
),
|
|
524
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
|
|
540
525
|
totalCount: data.total_count
|
|
541
526
|
};
|
|
542
527
|
};
|
|
@@ -569,10 +554,7 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
|
|
|
569
554
|
);
|
|
570
555
|
}
|
|
571
556
|
return {
|
|
572
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
573
|
-
data.server_private_networks,
|
|
574
|
-
unmarshalServerPrivateNetwork
|
|
575
|
-
)
|
|
557
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
|
|
576
558
|
};
|
|
577
559
|
};
|
|
578
560
|
const marshalSchemaPartition = (request, defaults) => ({
|
|
@@ -590,9 +572,7 @@ const marshalSchemaPool = (request, defaults) => ({
|
|
|
590
572
|
});
|
|
591
573
|
const marshalSchemaDisk = (request, defaults) => ({
|
|
592
574
|
device: request.device,
|
|
593
|
-
partitions: request.partitions.map(
|
|
594
|
-
(elt) => marshalSchemaPartition(elt)
|
|
595
|
-
)
|
|
575
|
+
partitions: request.partitions.map((elt) => marshalSchemaPartition(elt))
|
|
596
576
|
});
|
|
597
577
|
const marshalSchemaFilesystem = (request, defaults) => ({
|
|
598
578
|
device: request.device,
|
|
@@ -609,9 +589,7 @@ const marshalSchemaZFS = (request, defaults) => ({
|
|
|
609
589
|
});
|
|
610
590
|
const marshalSchema = (request, defaults) => ({
|
|
611
591
|
disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
|
|
612
|
-
filesystems: request.filesystems.map(
|
|
613
|
-
(elt) => marshalSchemaFilesystem(elt)
|
|
614
|
-
),
|
|
592
|
+
filesystems: request.filesystems.map((elt) => marshalSchemaFilesystem(elt)),
|
|
615
593
|
raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
|
|
616
594
|
zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
|
|
617
595
|
});
|
package/dist/v1/types.gen.d.ts
CHANGED
|
@@ -813,11 +813,11 @@ export interface BMCAccess {
|
|
|
813
813
|
*/
|
|
814
814
|
url: string;
|
|
815
815
|
/**
|
|
816
|
-
* The login to use for the BMC (Baseboard Management Controller) access
|
|
816
|
+
* The login to use for the BMC (Baseboard Management Controller) access authentication.
|
|
817
817
|
*/
|
|
818
818
|
login: string;
|
|
819
819
|
/**
|
|
820
|
-
* The password to use for the BMC (Baseboard Management Controller) access
|
|
820
|
+
* The password to use for the BMC (Baseboard Management Controller) access authentication.
|
|
821
821
|
*/
|
|
822
822
|
password: string;
|
|
823
823
|
/**
|
package/dist/v3/api.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality } from '@scaleway/sdk-client';
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
3
|
import type { ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, SetServerPrivateNetworksResponse } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Elastic Metal - Private Networks API.
|
package/dist/v3/api.gen.js
CHANGED
|
@@ -27,10 +27,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
27
27
|
addServerPrivateNetwork = (request) => this.client.fetch(
|
|
28
28
|
{
|
|
29
29
|
body: JSON.stringify(
|
|
30
|
-
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
|
|
31
|
-
request,
|
|
32
|
-
this.client.settings
|
|
33
|
-
)
|
|
30
|
+
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)
|
|
34
31
|
),
|
|
35
32
|
headers: jsonContentHeaders,
|
|
36
33
|
method: "POST",
|
|
@@ -47,10 +44,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
47
44
|
setServerPrivateNetworks = (request) => this.client.fetch(
|
|
48
45
|
{
|
|
49
46
|
body: JSON.stringify(
|
|
50
|
-
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
|
|
51
|
-
request,
|
|
52
|
-
this.client.settings
|
|
53
|
-
)
|
|
47
|
+
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)
|
|
54
48
|
),
|
|
55
49
|
headers: jsonContentHeaders,
|
|
56
50
|
method: "PUT",
|
|
@@ -67,10 +61,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
67
61
|
["order_by", request.orderBy],
|
|
68
62
|
["organization_id", request.organizationId],
|
|
69
63
|
["page", request.page],
|
|
70
|
-
[
|
|
71
|
-
"page_size",
|
|
72
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
73
|
-
],
|
|
64
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
74
65
|
["private_network_id", request.privateNetworkId],
|
|
75
66
|
["project_id", request.projectId],
|
|
76
67
|
["server_id", request.serverId]
|
|
@@ -84,20 +75,18 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
84
75
|
* @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
|
|
85
76
|
* @returns A Promise of ListServerPrivateNetworksResponse
|
|
86
77
|
*/
|
|
87
|
-
listServerPrivateNetworks = (request = {}) => enrichForPagination(
|
|
88
|
-
"serverPrivateNetworks",
|
|
89
|
-
this.pageOfListServerPrivateNetworks,
|
|
90
|
-
request
|
|
91
|
-
);
|
|
78
|
+
listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
|
|
92
79
|
/**
|
|
93
80
|
* Delete a Private Network.
|
|
94
81
|
*
|
|
95
82
|
* @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
|
|
96
83
|
*/
|
|
97
|
-
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
84
|
+
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
85
|
+
{
|
|
86
|
+
method: "DELETE",
|
|
87
|
+
path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
88
|
+
}
|
|
89
|
+
);
|
|
101
90
|
}
|
|
102
91
|
export {
|
|
103
92
|
PrivateNetworkAPI
|
package/dist/v3/content.gen.js
CHANGED
package/dist/v3/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PrivateNetworkAPI } from './api.gen.js';
|
|
1
|
+
export { PrivateNetworkAPI, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
4
|
export type { ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, ServerPrivateNetworkStatus, SetServerPrivateNetworksResponse, } from './types.gen.js';
|
|
@@ -24,10 +24,7 @@ const unmarshalListServerPrivateNetworksResponse = (data) => {
|
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
28
|
-
data.server_private_networks,
|
|
29
|
-
unmarshalServerPrivateNetwork
|
|
30
|
-
),
|
|
27
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
|
|
31
28
|
totalCount: data.total_count
|
|
32
29
|
};
|
|
33
30
|
};
|
|
@@ -38,10 +35,7 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
|
|
|
38
35
|
);
|
|
39
36
|
}
|
|
40
37
|
return {
|
|
41
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
42
|
-
data.server_private_networks,
|
|
43
|
-
unmarshalServerPrivateNetwork
|
|
44
|
-
)
|
|
38
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
|
|
45
39
|
};
|
|
46
40
|
};
|
|
47
41
|
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-baremetal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK baremetal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/baremetal"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "1.
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED