@scaleway/sdk-instance 1.4.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 +99 -111
- package/dist/v1/content.gen.js +16 -5
- package/dist/v1/index.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +59 -104
- package/dist/v1/types.gen.d.ts +5 -1
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -1198
- package/dist/v1/api.utils.cjs +0 -277
- package/dist/v1/content.gen.cjs +0 -51
- package/dist/v1/index.cjs +0 -16
- package/dist/v1/marshalling.gen.cjs +0 -1872
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-instance
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-instance)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-instance)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Instance 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-instance @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-instance @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-instance @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 { Instance } from '@scaleway/sdk-instance'
|
|
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 Instance.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 { Instance } from '@scaleway/sdk-instance'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Instance.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Instance API Documentation](https://www.scaleway.com/en/developers/api/instance/)
|
|
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 } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { ApplyBlockMigrationRequest, AttachServerFileSystemRequest, AttachServerFileSystemResponse, AttachServerVolumeRequest, AttachServerVolumeResponse, CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, CreateIpResponse, CreatePlacementGroupRequest, CreatePlacementGroupResponse, CreatePrivateNICRequest, CreatePrivateNICResponse, CreateSecurityGroupRequest, CreateSecurityGroupResponse, CreateSecurityGroupRuleRequest, CreateSecurityGroupRuleResponse, CreateServerRequest, CreateServerResponse, CreateSnapshotRequest, CreateSnapshotResponse, CreateVolumeRequest, CreateVolumeResponse, DeleteImageRequest, DeleteIpRequest, DeletePlacementGroupRequest, DeletePrivateNICRequest, DeleteSecurityGroupRequest, DeleteSecurityGroupRuleRequest, DeleteServerRequest, DeleteServerUserDataRequest, DeleteSnapshotRequest, DeleteVolumeRequest, DetachServerFileSystemRequest, DetachServerFileSystemResponse, DetachServerVolumeRequest, DetachServerVolumeResponse, ExportSnapshotRequest, ExportSnapshotResponse, GetDashboardRequest, GetDashboardResponse, GetImageRequest, GetImageResponse, GetIpRequest, GetIpResponse, GetPlacementGroupRequest, GetPlacementGroupResponse, GetPlacementGroupServersRequest, GetPlacementGroupServersResponse, GetPrivateNICRequest, GetPrivateNICResponse, GetSecurityGroupRequest, GetSecurityGroupResponse, GetSecurityGroupRuleRequest, GetSecurityGroupRuleResponse, GetServerCompatibleTypesRequest, GetServerRequest, GetServerResponse, GetServerTypesAvailabilityRequest, GetServerTypesAvailabilityResponse, GetSnapshotRequest, GetSnapshotResponse, GetVolumeRequest, GetVolumeResponse, ListDefaultSecurityGroupRulesRequest, ListImagesRequest, ListImagesResponse, ListIpsRequest, ListIpsResponse, ListPlacementGroupsRequest, ListPlacementGroupsResponse, ListPrivateNICsRequest, ListPrivateNICsResponse, ListSecurityGroupRulesRequest, ListSecurityGroupRulesResponse, ListSecurityGroupsRequest, ListSecurityGroupsResponse, ListServerActionsRequest, ListServerActionsResponse, ListServersRequest, ListServersResponse, ListServersTypesRequest, ListServersTypesResponse, ListServerUserDataRequest, ListServerUserDataResponse, ListSnapshotsRequest, ListSnapshotsResponse, ListVolumesRequest, ListVolumesResponse, ListVolumesTypesRequest, ListVolumesTypesResponse, MigrationPlan, PlanBlockMigrationRequest, PrivateNIC, ReleaseIpToIpamRequest, ServerActionRequest, ServerActionResponse, ServerCompatibleTypes, SetImageRequest, SetPlacementGroupRequest, SetPlacementGroupResponse, SetPlacementGroupServersRequest, SetPlacementGroupServersResponse, SetSecurityGroupRulesRequest, SetSecurityGroupRulesResponse, UpdateImageRequest, UpdateImageResponse, UpdateIpRequest, UpdateIpResponse, UpdatePlacementGroupRequest, UpdatePlacementGroupResponse, UpdatePlacementGroupServersRequest, UpdatePlacementGroupServersResponse, UpdatePrivateNICRequest, UpdateSecurityGroupRequest, UpdateSecurityGroupResponse, UpdateSecurityGroupRuleRequest, UpdateSecurityGroupRuleResponse, UpdateServerRequest, UpdateServerResponse, UpdateSnapshotRequest, UpdateSnapshotResponse, UpdateVolumeRequest, UpdateVolumeResponse } from './types.gen.js';
|
|
4
4
|
import type { SetImageResponse, SetSecurityGroupRequest, SetSecurityGroupResponse, SetSecurityGroupRuleRequest, SetSecurityGroupRuleResponse, SetServerRequest, SetServerResponse, SetSnapshotRequest, SetSnapshotResponse } from './types.private.gen.js';
|
|
5
5
|
/**
|
|
6
6
|
* Instance API.
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -85,21 +85,12 @@ class API extends API$1 {
|
|
|
85
85
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
86
86
|
["private_ip", request.privateIp],
|
|
87
87
|
["private_network", request.privateNetwork],
|
|
88
|
-
[
|
|
89
|
-
"private_networks",
|
|
90
|
-
request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(",") : void 0
|
|
91
|
-
],
|
|
88
|
+
["private_networks", request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(",") : void 0],
|
|
92
89
|
["private_nic_mac_address", request.privateNicMacAddress],
|
|
93
90
|
["project", request.project],
|
|
94
|
-
[
|
|
95
|
-
"servers",
|
|
96
|
-
request.servers && request.servers.length > 0 ? request.servers.join(",") : void 0
|
|
97
|
-
],
|
|
91
|
+
["servers", request.servers && request.servers.length > 0 ? request.servers.join(",") : void 0],
|
|
98
92
|
["state", request.state],
|
|
99
|
-
[
|
|
100
|
-
"tags",
|
|
101
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
102
|
-
],
|
|
93
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0],
|
|
103
94
|
["with_ip", request.withIp],
|
|
104
95
|
["without_ip", request.withoutIp]
|
|
105
96
|
)
|
|
@@ -129,10 +120,12 @@ class API extends API$1 {
|
|
|
129
120
|
*
|
|
130
121
|
* @param request - The request {@link DeleteServerRequest}
|
|
131
122
|
*/
|
|
132
|
-
deleteServer = (request) => this.client.fetch(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
123
|
+
deleteServer = (request) => this.client.fetch(
|
|
124
|
+
{
|
|
125
|
+
method: "DELETE",
|
|
126
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
|
|
127
|
+
}
|
|
128
|
+
);
|
|
136
129
|
/**
|
|
137
130
|
* Get an Instance. Get the details of a specified Instance.
|
|
138
131
|
*
|
|
@@ -231,10 +224,12 @@ class API extends API$1 {
|
|
|
231
224
|
*
|
|
232
225
|
* @param request - The request {@link DeleteServerUserDataRequest}
|
|
233
226
|
*/
|
|
234
|
-
deleteServerUserData = (request) => this.client.fetch(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
227
|
+
deleteServerUserData = (request) => this.client.fetch(
|
|
228
|
+
{
|
|
229
|
+
method: "DELETE",
|
|
230
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/user_data/${validatePathParam("key", request.key)}`
|
|
231
|
+
}
|
|
232
|
+
);
|
|
238
233
|
/**
|
|
239
234
|
* Get Instance compatible types. Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:
|
|
240
235
|
* the CPU architecture
|
|
@@ -408,10 +403,12 @@ class API extends API$1 {
|
|
|
408
403
|
*
|
|
409
404
|
* @param request - The request {@link DeleteImageRequest}
|
|
410
405
|
*/
|
|
411
|
-
deleteImage = (request) => this.client.fetch(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
406
|
+
deleteImage = (request) => this.client.fetch(
|
|
407
|
+
{
|
|
408
|
+
method: "DELETE",
|
|
409
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam("imageId", request.imageId)}`
|
|
410
|
+
}
|
|
411
|
+
);
|
|
415
412
|
pageOfListSnapshots = (request = {}) => this.client.fetch(
|
|
416
413
|
{
|
|
417
414
|
method: "GET",
|
|
@@ -498,10 +495,12 @@ class API extends API$1 {
|
|
|
498
495
|
*
|
|
499
496
|
* @param request - The request {@link DeleteSnapshotRequest}
|
|
500
497
|
*/
|
|
501
|
-
deleteSnapshot = (request) => this.client.fetch(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
498
|
+
deleteSnapshot = (request) => this.client.fetch(
|
|
499
|
+
{
|
|
500
|
+
method: "DELETE",
|
|
501
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
502
|
+
}
|
|
503
|
+
);
|
|
505
504
|
/**
|
|
506
505
|
* Export a snapshot. Export a snapshot to a specified Object Storage bucket in the same region.
|
|
507
506
|
*
|
|
@@ -529,10 +528,7 @@ class API extends API$1 {
|
|
|
529
528
|
["page", request.page],
|
|
530
529
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
531
530
|
["project", request.project],
|
|
532
|
-
[
|
|
533
|
-
"tags",
|
|
534
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
535
|
-
],
|
|
531
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0],
|
|
536
532
|
["volume_type", request.volumeType]
|
|
537
533
|
)
|
|
538
534
|
},
|
|
@@ -597,10 +593,12 @@ class API extends API$1 {
|
|
|
597
593
|
*
|
|
598
594
|
* @param request - The request {@link DeleteVolumeRequest}
|
|
599
595
|
*/
|
|
600
|
-
deleteVolume = (request) => this.client.fetch(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
596
|
+
deleteVolume = (request) => this.client.fetch(
|
|
597
|
+
{
|
|
598
|
+
method: "DELETE",
|
|
599
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
600
|
+
}
|
|
601
|
+
);
|
|
604
602
|
pageOfListSecurityGroups = (request = {}) => this.client.fetch(
|
|
605
603
|
{
|
|
606
604
|
method: "GET",
|
|
@@ -612,10 +610,7 @@ class API extends API$1 {
|
|
|
612
610
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
613
611
|
["project", request.project],
|
|
614
612
|
["project_default", request.projectDefault],
|
|
615
|
-
[
|
|
616
|
-
"tags",
|
|
617
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
618
|
-
]
|
|
613
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0]
|
|
619
614
|
)
|
|
620
615
|
},
|
|
621
616
|
unmarshalListSecurityGroupsResponse
|
|
@@ -626,11 +621,7 @@ class API extends API$1 {
|
|
|
626
621
|
* @param request - The request {@link ListSecurityGroupsRequest}
|
|
627
622
|
* @returns A Promise of ListSecurityGroupsResponse
|
|
628
623
|
*/
|
|
629
|
-
listSecurityGroups = (request = {}) => enrichForPagination(
|
|
630
|
-
"securityGroups",
|
|
631
|
-
this.pageOfListSecurityGroups,
|
|
632
|
-
request
|
|
633
|
-
);
|
|
624
|
+
listSecurityGroups = (request = {}) => enrichForPagination("securityGroups", this.pageOfListSecurityGroups, request);
|
|
634
625
|
/**
|
|
635
626
|
* Create a security group. Create a security group with a specified name and description.
|
|
636
627
|
*
|
|
@@ -666,10 +657,12 @@ class API extends API$1 {
|
|
|
666
657
|
*
|
|
667
658
|
* @param request - The request {@link DeleteSecurityGroupRequest}
|
|
668
659
|
*/
|
|
669
|
-
deleteSecurityGroup = (request) => this.client.fetch(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
660
|
+
deleteSecurityGroup = (request) => this.client.fetch(
|
|
661
|
+
{
|
|
662
|
+
method: "DELETE",
|
|
663
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam("securityGroupId", request.securityGroupId)}`
|
|
664
|
+
}
|
|
665
|
+
);
|
|
673
666
|
_setSecurityGroup = (request) => this.client.fetch(
|
|
674
667
|
{
|
|
675
668
|
body: JSON.stringify(
|
|
@@ -768,10 +761,12 @@ class API extends API$1 {
|
|
|
768
761
|
*
|
|
769
762
|
* @param request - The request {@link DeleteSecurityGroupRuleRequest}
|
|
770
763
|
*/
|
|
771
|
-
deleteSecurityGroupRule = (request) => this.client.fetch(
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
764
|
+
deleteSecurityGroupRule = (request) => this.client.fetch(
|
|
765
|
+
{
|
|
766
|
+
method: "DELETE",
|
|
767
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam("securityGroupId", request.securityGroupId)}/rules/${validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}`
|
|
768
|
+
}
|
|
769
|
+
);
|
|
775
770
|
/**
|
|
776
771
|
* Get rule. Get details of a security group rule with the specified ID.
|
|
777
772
|
*
|
|
@@ -823,10 +818,7 @@ class API extends API$1 {
|
|
|
823
818
|
["page", request.page],
|
|
824
819
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
825
820
|
["project", request.project],
|
|
826
|
-
[
|
|
827
|
-
"tags",
|
|
828
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
829
|
-
]
|
|
821
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0]
|
|
830
822
|
)
|
|
831
823
|
},
|
|
832
824
|
unmarshalListPlacementGroupsResponse
|
|
@@ -837,11 +829,7 @@ class API extends API$1 {
|
|
|
837
829
|
* @param request - The request {@link ListPlacementGroupsRequest}
|
|
838
830
|
* @returns A Promise of ListPlacementGroupsResponse
|
|
839
831
|
*/
|
|
840
|
-
listPlacementGroups = (request = {}) => enrichForPagination(
|
|
841
|
-
"placementGroups",
|
|
842
|
-
this.pageOfListPlacementGroups,
|
|
843
|
-
request
|
|
844
|
-
);
|
|
832
|
+
listPlacementGroups = (request = {}) => enrichForPagination("placementGroups", this.pageOfListPlacementGroups, request);
|
|
845
833
|
/**
|
|
846
834
|
* Create a placement group. Create a new placement group in a specified Availability Zone.
|
|
847
835
|
*
|
|
@@ -911,10 +899,12 @@ class API extends API$1 {
|
|
|
911
899
|
*
|
|
912
900
|
* @param request - The request {@link DeletePlacementGroupRequest}
|
|
913
901
|
*/
|
|
914
|
-
deletePlacementGroup = (request) => this.client.fetch(
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
902
|
+
deletePlacementGroup = (request) => this.client.fetch(
|
|
903
|
+
{
|
|
904
|
+
method: "DELETE",
|
|
905
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam("placementGroupId", request.placementGroupId)}`
|
|
906
|
+
}
|
|
907
|
+
);
|
|
918
908
|
/**
|
|
919
909
|
* Get placement group servers. Get all Instances belonging to the specified placement group.
|
|
920
910
|
*
|
|
@@ -954,10 +944,7 @@ class API extends API$1 {
|
|
|
954
944
|
updatePlacementGroupServers = (request) => this.client.fetch(
|
|
955
945
|
{
|
|
956
946
|
body: JSON.stringify(
|
|
957
|
-
marshalUpdatePlacementGroupServersRequest(
|
|
958
|
-
request,
|
|
959
|
-
this.client.settings
|
|
960
|
-
)
|
|
947
|
+
marshalUpdatePlacementGroupServersRequest(request, this.client.settings)
|
|
961
948
|
),
|
|
962
949
|
headers: jsonContentHeaders,
|
|
963
950
|
method: "PATCH",
|
|
@@ -975,10 +962,7 @@ class API extends API$1 {
|
|
|
975
962
|
["page", request.page],
|
|
976
963
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
977
964
|
["project", request.project],
|
|
978
|
-
[
|
|
979
|
-
"tags",
|
|
980
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
981
|
-
],
|
|
965
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0],
|
|
982
966
|
["type", request.type]
|
|
983
967
|
)
|
|
984
968
|
},
|
|
@@ -1043,10 +1027,12 @@ class API extends API$1 {
|
|
|
1043
1027
|
*
|
|
1044
1028
|
* @param request - The request {@link DeleteIpRequest}
|
|
1045
1029
|
*/
|
|
1046
|
-
deleteIp = (request) => this.client.fetch(
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1030
|
+
deleteIp = (request) => this.client.fetch(
|
|
1031
|
+
{
|
|
1032
|
+
method: "DELETE",
|
|
1033
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ip", request.ip)}`
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
1050
1036
|
pageOfListPrivateNICs = (request) => this.client.fetch(
|
|
1051
1037
|
{
|
|
1052
1038
|
method: "GET",
|
|
@@ -1054,10 +1040,7 @@ class API extends API$1 {
|
|
|
1054
1040
|
urlParams: urlParams(
|
|
1055
1041
|
["page", request.page],
|
|
1056
1042
|
["per_page", request.perPage ?? this.client.settings.defaultPageSize],
|
|
1057
|
-
[
|
|
1058
|
-
"tags",
|
|
1059
|
-
request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
|
|
1060
|
-
]
|
|
1043
|
+
["tags", request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0]
|
|
1061
1044
|
)
|
|
1062
1045
|
},
|
|
1063
1046
|
unmarshalListPrivateNICsResponse
|
|
@@ -1121,10 +1104,12 @@ class API extends API$1 {
|
|
|
1121
1104
|
*
|
|
1122
1105
|
* @param request - The request {@link DeletePrivateNICRequest}
|
|
1123
1106
|
*/
|
|
1124
|
-
deletePrivateNIC = (request) => this.client.fetch(
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1107
|
+
deletePrivateNIC = (request) => this.client.fetch(
|
|
1108
|
+
{
|
|
1109
|
+
method: "DELETE",
|
|
1110
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private_nics/${validatePathParam("privateNicId", request.privateNicId)}`
|
|
1111
|
+
}
|
|
1112
|
+
);
|
|
1128
1113
|
getDashboard = (request = {}) => this.client.fetch(
|
|
1129
1114
|
{
|
|
1130
1115
|
method: "GET",
|
|
@@ -1162,36 +1147,39 @@ class API extends API$1 {
|
|
|
1162
1147
|
*
|
|
1163
1148
|
* @param request - The request {@link ApplyBlockMigrationRequest}
|
|
1164
1149
|
*/
|
|
1165
|
-
applyBlockMigration = (request) => this.client.fetch(
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1150
|
+
applyBlockMigration = (request) => this.client.fetch(
|
|
1151
|
+
{
|
|
1152
|
+
body: JSON.stringify(
|
|
1153
|
+
marshalApplyBlockMigrationRequest(request, this.client.settings)
|
|
1154
|
+
),
|
|
1155
|
+
headers: jsonContentHeaders,
|
|
1156
|
+
method: "POST",
|
|
1157
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
checkBlockMigrationOrganizationQuotas = (request = {}) => this.client.fetch(
|
|
1161
|
+
{
|
|
1162
|
+
body: JSON.stringify(
|
|
1163
|
+
marshalCheckBlockMigrationOrganizationQuotasRequest(request, this.client.settings)
|
|
1164
|
+
),
|
|
1165
|
+
headers: jsonContentHeaders,
|
|
1166
|
+
method: "POST",
|
|
1167
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1184
1170
|
/**
|
|
1185
1171
|
* Releases the reserved IP without deleting the reservation.. **The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product).
|
|
1186
1172
|
*
|
|
1187
1173
|
* @param request - The request {@link ReleaseIpToIpamRequest}
|
|
1188
1174
|
*/
|
|
1189
|
-
releaseIpToIpam = (request) => this.client.fetch(
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1175
|
+
releaseIpToIpam = (request) => this.client.fetch(
|
|
1176
|
+
{
|
|
1177
|
+
body: "{}",
|
|
1178
|
+
headers: jsonContentHeaders,
|
|
1179
|
+
method: "POST",
|
|
1180
|
+
path: `/instance/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}/release-to-ipam`
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1195
1183
|
}
|
|
1196
1184
|
export {
|
|
1197
1185
|
API
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
const IMAGE_TRANSIENT_STATUSES = [
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const IMAGE_TRANSIENT_STATUSES = [
|
|
2
|
+
"creating"
|
|
3
|
+
];
|
|
4
|
+
const IP_TRANSIENT_STATUSES = [
|
|
5
|
+
"pending"
|
|
6
|
+
];
|
|
7
|
+
const PRIVATE_NIC_TRANSIENT_STATUSES = [
|
|
8
|
+
"syncing"
|
|
9
|
+
];
|
|
4
10
|
const SECURITY_GROUP_TRANSIENT_STATUSES = [
|
|
5
11
|
"syncing"
|
|
6
12
|
];
|
|
@@ -8,8 +14,13 @@ const SERVER_FILESYSTEM_TRANSIENT_STATUSES = [
|
|
|
8
14
|
"attaching",
|
|
9
15
|
"detaching"
|
|
10
16
|
];
|
|
11
|
-
const SERVER_IP_TRANSIENT_STATUSES = [
|
|
12
|
-
|
|
17
|
+
const SERVER_IP_TRANSIENT_STATUSES = [
|
|
18
|
+
"pending"
|
|
19
|
+
];
|
|
20
|
+
const SERVER_TRANSIENT_STATUSES = [
|
|
21
|
+
"starting",
|
|
22
|
+
"stopping"
|
|
23
|
+
];
|
|
13
24
|
const SNAPSHOT_TRANSIENT_STATUSES = [
|
|
14
25
|
"snapshotting",
|
|
15
26
|
"importing",
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { ApplyBlockMigrationRequest, Arch, AttachServerFileSystemRequest, AttachServerFileSystemResponse, AttachServerVolumeRequest, AttachServerVolumeRequestVolumeType, AttachServerVolumeResponse,
|
|
4
|
+
export type { ApplyBlockMigrationRequest, Arch, AttachServerFileSystemRequest, AttachServerFileSystemResponse, AttachServerVolumeRequest, AttachServerVolumeRequestVolumeType, AttachServerVolumeResponse, Bootscript, BootType, CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, CreateIpResponse, CreatePlacementGroupRequest, CreatePlacementGroupResponse, CreatePrivateNICRequest, CreatePrivateNICResponse, CreateSecurityGroupRequest, CreateSecurityGroupResponse, CreateSecurityGroupRuleRequest, CreateSecurityGroupRuleResponse, CreateServerRequest, CreateServerResponse, CreateSnapshotRequest, CreateSnapshotResponse, CreateVolumeRequest, CreateVolumeResponse, Dashboard, DeleteImageRequest, DeleteIpRequest, DeletePlacementGroupRequest, DeletePrivateNICRequest, DeleteSecurityGroupRequest, DeleteSecurityGroupRuleRequest, DeleteServerRequest, DeleteServerUserDataRequest, DeleteSnapshotRequest, DeleteVolumeRequest, DetachServerFileSystemRequest, DetachServerFileSystemResponse, DetachServerVolumeRequest, DetachServerVolumeResponse, ExportSnapshotRequest, ExportSnapshotResponse, GetDashboardRequest, GetDashboardResponse, GetImageRequest, GetImageResponse, GetIpRequest, GetIpResponse, GetPlacementGroupRequest, GetPlacementGroupResponse, GetPlacementGroupServersRequest, GetPlacementGroupServersResponse, GetPrivateNICRequest, GetPrivateNICResponse, GetSecurityGroupRequest, GetSecurityGroupResponse, GetSecurityGroupRuleRequest, GetSecurityGroupRuleResponse, GetServerCompatibleTypesRequest, GetServerRequest, GetServerResponse, GetServerTypesAvailabilityRequest, GetServerTypesAvailabilityResponse, GetServerTypesAvailabilityResponseAvailability, GetSnapshotRequest, GetSnapshotResponse, GetVolumeRequest, GetVolumeResponse, Image, ImageState, Ip, IpState, IpType, ListDefaultSecurityGroupRulesRequest, ListImagesRequest, ListImagesResponse, ListIpsRequest, ListIpsResponse, ListPlacementGroupsRequest, ListPlacementGroupsResponse, ListPrivateNICsRequest, ListPrivateNICsResponse, ListSecurityGroupRulesRequest, ListSecurityGroupRulesResponse, ListSecurityGroupsRequest, ListSecurityGroupsResponse, ListServerActionsRequest, ListServerActionsResponse, ListServersRequest, ListServersRequestOrder, ListServersResponse, ListServersTypesRequest, ListServersTypesResponse, ListServerUserDataRequest, ListServerUserDataResponse, ListSnapshotsRequest, ListSnapshotsResponse, ListVolumesRequest, ListVolumesResponse, ListVolumesTypesRequest, ListVolumesTypesResponse, MigrationPlan, PlacementGroup, PlacementGroupPolicyMode, PlacementGroupPolicyType, PlacementGroupServer, PlanBlockMigrationRequest, PrivateNIC, PrivateNICState, ReleaseIpToIpamRequest, SecurityGroup, SecurityGroupPolicy, SecurityGroupRule, SecurityGroupRuleAction, SecurityGroupRuleDirection, SecurityGroupRuleProtocol, SecurityGroupState, SecurityGroupSummary, SecurityGroupTemplate, Server, ServerAction, ServerActionRequest, ServerActionRequestVolumeBackupTemplate, ServerActionResponse, ServerCompatibleTypes, ServerFilesystem, ServerFilesystemState, ServerIp, ServerIpIpFamily, ServerIpProvisioningMode, ServerIpState, ServerIpv6, ServerLocation, ServerMaintenance, ServerState, ServerSummary, ServerType, ServerTypeCapabilities, ServerTypeGPUInfo, ServerTypeNetwork, ServerTypeNetworkInterface, ServerTypesAvailability, ServerTypeVolumeConstraintSizes, ServerTypeVolumeConstraintsByType, SetImageRequest, SetPlacementGroupRequest, SetPlacementGroupResponse, SetPlacementGroupServersRequest, SetPlacementGroupServersResponse, SetSecurityGroupRulesRequest, SetSecurityGroupRulesRequestRule, SetSecurityGroupRulesResponse, Snapshot, SnapshotBaseVolume, SnapshotState, SnapshotVolumeType, Task, TaskStatus, UpdateImageRequest, UpdateImageResponse, UpdateIpRequest, UpdateIpResponse, UpdatePlacementGroupRequest, UpdatePlacementGroupResponse, UpdatePlacementGroupServersRequest, UpdatePlacementGroupServersResponse, UpdatePrivateNICRequest, UpdateSecurityGroupRequest, UpdateSecurityGroupResponse, UpdateSecurityGroupRuleRequest, UpdateSecurityGroupRuleResponse, UpdateServerRequest, UpdateServerResponse, UpdateSnapshotRequest, UpdateSnapshotResponse, UpdateVolumeRequest, UpdateVolumeResponse, Volume, VolumeImageUpdateTemplate, VolumeServer, VolumeServerState, VolumeServerTemplate, VolumeServerVolumeType, VolumeState, VolumeSummary, VolumeTemplate, VolumeType, VolumeTypeCapabilities, VolumeTypeConstraints, VolumeVolumeType, } 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 { ApplyBlockMigrationRequest, AttachServerFileSystemRequest, AttachServerFileSystemResponse, AttachServerVolumeRequest, AttachServerVolumeResponse, CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, CreateIpResponse, CreatePlacementGroupRequest, CreatePlacementGroupResponse, CreatePrivateNICRequest, CreatePrivateNICResponse, CreateSecurityGroupRequest, CreateSecurityGroupResponse, CreateSecurityGroupRuleRequest, CreateSecurityGroupRuleResponse, CreateServerRequest, CreateServerResponse, CreateSnapshotRequest, CreateSnapshotResponse, CreateVolumeRequest, CreateVolumeResponse, DetachServerFileSystemRequest, DetachServerFileSystemResponse, DetachServerVolumeRequest, DetachServerVolumeResponse, ExportSnapshotRequest, ExportSnapshotResponse, GetDashboardResponse, GetImageResponse, GetIpResponse, GetPlacementGroupResponse, GetPlacementGroupServersResponse, GetPrivateNICResponse, GetSecurityGroupResponse, GetSecurityGroupRuleResponse, GetServerResponse, GetServerTypesAvailabilityResponse, GetSnapshotResponse, GetVolumeResponse, ListImagesResponse, ListIpsResponse, ListPlacementGroupsResponse, ListPrivateNICsResponse, ListSecurityGroupRulesResponse, ListSecurityGroupsResponse, ListServerActionsResponse,
|
|
2
|
+
import type { ApplyBlockMigrationRequest, AttachServerFileSystemRequest, AttachServerFileSystemResponse, AttachServerVolumeRequest, AttachServerVolumeResponse, CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, CreateIpResponse, CreatePlacementGroupRequest, CreatePlacementGroupResponse, CreatePrivateNICRequest, CreatePrivateNICResponse, CreateSecurityGroupRequest, CreateSecurityGroupResponse, CreateSecurityGroupRuleRequest, CreateSecurityGroupRuleResponse, CreateServerRequest, CreateServerResponse, CreateSnapshotRequest, CreateSnapshotResponse, CreateVolumeRequest, CreateVolumeResponse, DetachServerFileSystemRequest, DetachServerFileSystemResponse, DetachServerVolumeRequest, DetachServerVolumeResponse, ExportSnapshotRequest, ExportSnapshotResponse, GetDashboardResponse, GetImageResponse, GetIpResponse, GetPlacementGroupResponse, GetPlacementGroupServersResponse, GetPrivateNICResponse, GetSecurityGroupResponse, GetSecurityGroupRuleResponse, GetServerResponse, GetServerTypesAvailabilityResponse, GetSnapshotResponse, GetVolumeResponse, ListImagesResponse, ListIpsResponse, ListPlacementGroupsResponse, ListPrivateNICsResponse, ListSecurityGroupRulesResponse, ListSecurityGroupsResponse, ListServerActionsResponse, ListServersResponse, ListServersTypesResponse, ListServerUserDataResponse, ListSnapshotsResponse, ListVolumesResponse, ListVolumesTypesResponse, MigrationPlan, PlanBlockMigrationRequest, PrivateNIC, ServerActionRequest, ServerActionResponse, ServerCompatibleTypes, SetImageRequest, SetPlacementGroupRequest, SetPlacementGroupResponse, SetPlacementGroupServersRequest, SetPlacementGroupServersResponse, SetSecurityGroupRulesRequest, SetSecurityGroupRulesResponse, UpdateImageRequest, UpdateImageResponse, UpdateIpRequest, UpdateIpResponse, UpdatePlacementGroupRequest, UpdatePlacementGroupResponse, UpdatePlacementGroupServersRequest, UpdatePlacementGroupServersResponse, UpdatePrivateNICRequest, UpdateSecurityGroupRequest, UpdateSecurityGroupResponse, UpdateSecurityGroupRuleRequest, UpdateSecurityGroupRuleResponse, UpdateServerRequest, UpdateServerResponse, UpdateSnapshotRequest, UpdateSnapshotResponse, UpdateVolumeRequest, UpdateVolumeResponse } from './types.gen.js';
|
|
3
3
|
import type { SetImageResponse, SetSecurityGroupRequest, SetSecurityGroupResponse, SetSecurityGroupRuleRequest, SetSecurityGroupRuleResponse, SetServerRequest, SetServerResponse, SetSnapshotRequest, SetSnapshotResponse } from './types.private.gen.js';
|
|
4
4
|
export declare const unmarshalPrivateNIC: (data: unknown) => PrivateNIC;
|
|
5
5
|
export declare const unmarshalAttachServerFileSystemResponse: (data: unknown) => AttachServerFileSystemResponse;
|