@scaleway/sdk-block 1.2.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 +21 -35
- package/dist/v1/index.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +7 -4
- package/dist/v1/types.gen.d.ts +5 -1
- package/dist/v1alpha1/api.gen.d.ts +2 -2
- package/dist/v1alpha1/api.gen.js +19 -34
- package/dist/v1alpha1/index.gen.d.ts +2 -2
- package/dist/v1alpha1/marshalling.gen.d.ts +1 -1
- package/dist/v1alpha1/marshalling.gen.js +7 -4
- package/dist/v1alpha1/types.gen.d.ts +1 -1
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -6
- package/dist/v1/api.gen.cjs +0 -292
- package/dist/v1/content.gen.cjs +0 -22
- package/dist/v1/index.gen.cjs +0 -23
- package/dist/v1/marshalling.gen.cjs +0 -198
- package/dist/v1/validation-rules.gen.cjs +0 -56
- package/dist/v1alpha1/api.gen.cjs +0 -310
- package/dist/v1alpha1/content.gen.cjs +0 -22
- package/dist/v1alpha1/index.gen.cjs +0 -23
- package/dist/v1alpha1/marshalling.gen.cjs +0 -206
- package/dist/v1alpha1/validation-rules.gen.cjs +0 -62
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-block
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-block)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-block)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Block 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-block @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-block @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-block @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 { Block } from '@scaleway/sdk-block'
|
|
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 Block.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 { Block } from '@scaleway/sdk-block'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Block.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Block API Documentation](https://www.scaleway.com/en/developers/api/block/)
|
|
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 { CreateSnapshotRequest, CreateVolumeRequest, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsRequest, ListSnapshotsResponse, ListVolumesRequest, ListVolumesResponse, ListVolumeTypesRequest, ListVolumeTypesResponse, Snapshot, UpdateSnapshotRequest, UpdateVolumeRequest, Volume } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Block Storage API.
|
|
6
6
|
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -28,10 +28,7 @@ class API extends API$1 {
|
|
|
28
28
|
path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`,
|
|
29
29
|
urlParams: urlParams(
|
|
30
30
|
["page", request.page],
|
|
31
|
-
[
|
|
32
|
-
"page_size",
|
|
33
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
34
|
-
]
|
|
31
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
35
32
|
)
|
|
36
33
|
},
|
|
37
34
|
unmarshalListVolumeTypesResponse
|
|
@@ -53,13 +50,11 @@ class API extends API$1 {
|
|
|
53
50
|
["order_by", request.orderBy],
|
|
54
51
|
["organization_id", request.organizationId],
|
|
55
52
|
["page", request.page],
|
|
56
|
-
[
|
|
57
|
-
"page_size",
|
|
58
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
59
|
-
],
|
|
53
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
60
54
|
["product_resource_id", request.productResourceId],
|
|
61
55
|
["project_id", request.projectId],
|
|
62
|
-
["tags", request.tags]
|
|
56
|
+
["tags", request.tags],
|
|
57
|
+
["volume_type", request.volumeType]
|
|
63
58
|
)
|
|
64
59
|
},
|
|
65
60
|
unmarshalListVolumesResponse
|
|
@@ -110,9 +105,7 @@ class API extends API$1 {
|
|
|
110
105
|
* @returns A Promise of Volume
|
|
111
106
|
*/
|
|
112
107
|
waitForVolume = (request, options) => waitForResource(
|
|
113
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
114
|
-
!VOLUME_TRANSIENT_STATUSES.includes(res.status)
|
|
115
|
-
)),
|
|
108
|
+
options?.stop ?? ((res) => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))),
|
|
116
109
|
this.getVolume,
|
|
117
110
|
request,
|
|
118
111
|
options
|
|
@@ -122,10 +115,12 @@ class API extends API$1 {
|
|
|
122
115
|
*
|
|
123
116
|
* @param request - The request {@link DeleteVolumeRequest}
|
|
124
117
|
*/
|
|
125
|
-
deleteVolume = (request) => this.client.fetch(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
deleteVolume = (request) => this.client.fetch(
|
|
119
|
+
{
|
|
120
|
+
method: "DELETE",
|
|
121
|
+
path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
122
|
+
}
|
|
123
|
+
);
|
|
129
124
|
/**
|
|
130
125
|
* Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class).
|
|
131
126
|
You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
|
|
@@ -154,10 +149,7 @@ class API extends API$1 {
|
|
|
154
149
|
["order_by", request.orderBy],
|
|
155
150
|
["organization_id", request.organizationId],
|
|
156
151
|
["page", request.page],
|
|
157
|
-
[
|
|
158
|
-
"page_size",
|
|
159
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
160
|
-
],
|
|
152
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
161
153
|
["project_id", request.projectId],
|
|
162
154
|
["tags", request.tags],
|
|
163
155
|
["volume_id", request.volumeId]
|
|
@@ -193,9 +185,7 @@ class API extends API$1 {
|
|
|
193
185
|
* @returns A Promise of Snapshot
|
|
194
186
|
*/
|
|
195
187
|
waitForSnapshot = (request, options) => waitForResource(
|
|
196
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
197
|
-
!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status)
|
|
198
|
-
)),
|
|
188
|
+
options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),
|
|
199
189
|
this.getSnapshot,
|
|
200
190
|
request,
|
|
201
191
|
options
|
|
@@ -228,10 +218,7 @@ class API extends API$1 {
|
|
|
228
218
|
importSnapshotFromObjectStorage = (request) => this.client.fetch(
|
|
229
219
|
{
|
|
230
220
|
body: JSON.stringify(
|
|
231
|
-
marshalImportSnapshotFromObjectStorageRequest(
|
|
232
|
-
request,
|
|
233
|
-
this.client.settings
|
|
234
|
-
)
|
|
221
|
+
marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)
|
|
235
222
|
),
|
|
236
223
|
headers: jsonContentHeaders,
|
|
237
224
|
method: "POST",
|
|
@@ -249,10 +236,7 @@ class API extends API$1 {
|
|
|
249
236
|
exportSnapshotToObjectStorage = (request) => this.client.fetch(
|
|
250
237
|
{
|
|
251
238
|
body: JSON.stringify(
|
|
252
|
-
marshalExportSnapshotToObjectStorageRequest(
|
|
253
|
-
request,
|
|
254
|
-
this.client.settings
|
|
255
|
-
)
|
|
239
|
+
marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)
|
|
256
240
|
),
|
|
257
241
|
headers: jsonContentHeaders,
|
|
258
242
|
method: "POST",
|
|
@@ -265,10 +249,12 @@ class API extends API$1 {
|
|
|
265
249
|
*
|
|
266
250
|
* @param request - The request {@link DeleteSnapshotRequest}
|
|
267
251
|
*/
|
|
268
|
-
deleteSnapshot = (request) => this.client.fetch(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
252
|
+
deleteSnapshot = (request) => this.client.fetch(
|
|
253
|
+
{
|
|
254
|
+
method: "DELETE",
|
|
255
|
+
path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
256
|
+
}
|
|
257
|
+
);
|
|
272
258
|
/**
|
|
273
259
|
* Update a snapshot. Update the name or tags of the snapshot.
|
|
274
260
|
*
|
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 { CreateSnapshotRequest, CreateVolumeRequest, CreateVolumeRequestFromEmpty, CreateVolumeRequestFromSnapshot, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse,
|
|
4
|
+
export type { CreateSnapshotRequest, CreateVolumeRequest, CreateVolumeRequestFromEmpty, CreateVolumeRequestFromSnapshot, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse, ListVolumesRequest, ListVolumesRequestOrderBy, ListVolumesResponse, ListVolumeTypesRequest, ListVolumeTypesResponse, Reference, ReferenceStatus, ReferenceType, Snapshot, SnapshotParentVolume, SnapshotStatus, StorageClass, UpdateSnapshotRequest, UpdateVolumeRequest, Volume, VolumeSpecifications, VolumeStatus, VolumeType, } 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 { CreateSnapshotRequest, CreateVolumeRequest, ExportSnapshotToObjectStorageRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsResponse,
|
|
2
|
+
import type { CreateSnapshotRequest, CreateVolumeRequest, ExportSnapshotToObjectStorageRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsResponse, ListVolumesResponse, ListVolumeTypesResponse, Reference, Snapshot, UpdateSnapshotRequest, UpdateVolumeRequest, Volume } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalReference: (data: unknown) => Reference;
|
|
4
4
|
export declare const unmarshalSnapshot: (data: unknown) => Snapshot;
|
|
5
5
|
export declare const unmarshalVolume: (data: unknown) => Volume;
|
|
@@ -153,12 +153,15 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
param: "from_snapshot",
|
|
156
|
-
value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(
|
|
157
|
-
request.fromSnapshot
|
|
158
|
-
) : void 0
|
|
156
|
+
value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : void 0
|
|
159
157
|
}
|
|
160
158
|
]),
|
|
161
|
-
...resolveOneOf([
|
|
159
|
+
...resolveOneOf([
|
|
160
|
+
{
|
|
161
|
+
param: "perf_iops",
|
|
162
|
+
value: request.perfIops
|
|
163
|
+
}
|
|
164
|
+
])
|
|
162
165
|
});
|
|
163
166
|
const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
|
|
164
167
|
bucket: request.bucket,
|
package/dist/v1/types.gen.d.ts
CHANGED
|
@@ -397,7 +397,7 @@ export interface ListSnapshotsResponse {
|
|
|
397
397
|
*/
|
|
398
398
|
snapshots: Snapshot[];
|
|
399
399
|
/**
|
|
400
|
-
* Total number of
|
|
400
|
+
* Total number of snapshots in the project.
|
|
401
401
|
*/
|
|
402
402
|
totalCount: number;
|
|
403
403
|
}
|
|
@@ -466,6 +466,10 @@ export type ListVolumesRequest = {
|
|
|
466
466
|
* Display deleted volumes not erased yet.
|
|
467
467
|
*/
|
|
468
468
|
includeDeleted: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Filter by volume type.
|
|
471
|
+
*/
|
|
472
|
+
volumeType?: string;
|
|
469
473
|
};
|
|
470
474
|
export interface ListVolumesResponse {
|
|
471
475
|
/**
|
|
@@ -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 { CreateSnapshotRequest, CreateVolumeRequest, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListSnapshotsResponse, ListVolumesRequest, ListVolumesResponse, ListVolumeTypesRequest, ListVolumeTypesResponse, Snapshot, UpdateSnapshotRequest, UpdateVolumeRequest, Volume } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Block Storage API.
|
|
6
6
|
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -28,10 +28,7 @@ class API extends API$1 {
|
|
|
28
28
|
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`,
|
|
29
29
|
urlParams: urlParams(
|
|
30
30
|
["page", request.page],
|
|
31
|
-
[
|
|
32
|
-
"page_size",
|
|
33
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
34
|
-
]
|
|
31
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
35
32
|
)
|
|
36
33
|
},
|
|
37
34
|
unmarshalListVolumeTypesResponse
|
|
@@ -52,10 +49,7 @@ class API extends API$1 {
|
|
|
52
49
|
["order_by", request.orderBy],
|
|
53
50
|
["organization_id", request.organizationId],
|
|
54
51
|
["page", request.page],
|
|
55
|
-
[
|
|
56
|
-
"page_size",
|
|
57
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
58
|
-
],
|
|
52
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
59
53
|
["product_resource_id", request.productResourceId],
|
|
60
54
|
["project_id", request.projectId],
|
|
61
55
|
["tags", request.tags]
|
|
@@ -109,9 +103,7 @@ class API extends API$1 {
|
|
|
109
103
|
* @returns A Promise of Volume
|
|
110
104
|
*/
|
|
111
105
|
waitForVolume = (request, options) => waitForResource(
|
|
112
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
113
|
-
!VOLUME_TRANSIENT_STATUSES.includes(res.status)
|
|
114
|
-
)),
|
|
106
|
+
options?.stop ?? ((res) => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))),
|
|
115
107
|
this.getVolume,
|
|
116
108
|
request,
|
|
117
109
|
options
|
|
@@ -121,10 +113,12 @@ class API extends API$1 {
|
|
|
121
113
|
*
|
|
122
114
|
* @param request - The request {@link DeleteVolumeRequest}
|
|
123
115
|
*/
|
|
124
|
-
deleteVolume = (request) => this.client.fetch(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
deleteVolume = (request) => this.client.fetch(
|
|
117
|
+
{
|
|
118
|
+
method: "DELETE",
|
|
119
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
120
|
+
}
|
|
121
|
+
);
|
|
128
122
|
/**
|
|
129
123
|
* Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class).
|
|
130
124
|
You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
|
|
@@ -152,10 +146,7 @@ class API extends API$1 {
|
|
|
152
146
|
["order_by", request.orderBy],
|
|
153
147
|
["organization_id", request.organizationId],
|
|
154
148
|
["page", request.page],
|
|
155
|
-
[
|
|
156
|
-
"page_size",
|
|
157
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
158
|
-
],
|
|
149
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
159
150
|
["project_id", request.projectId],
|
|
160
151
|
["tags", request.tags],
|
|
161
152
|
["volume_id", request.volumeId]
|
|
@@ -191,9 +182,7 @@ class API extends API$1 {
|
|
|
191
182
|
* @returns A Promise of Snapshot
|
|
192
183
|
*/
|
|
193
184
|
waitForSnapshot = (request, options) => waitForResource(
|
|
194
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
195
|
-
!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status)
|
|
196
|
-
)),
|
|
185
|
+
options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),
|
|
197
186
|
this.getSnapshot,
|
|
198
187
|
request,
|
|
199
188
|
options
|
|
@@ -246,10 +235,7 @@ class API extends API$1 {
|
|
|
246
235
|
importSnapshotFromObjectStorage = (request) => this.client.fetch(
|
|
247
236
|
{
|
|
248
237
|
body: JSON.stringify(
|
|
249
|
-
marshalImportSnapshotFromObjectStorageRequest(
|
|
250
|
-
request,
|
|
251
|
-
this.client.settings
|
|
252
|
-
)
|
|
238
|
+
marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)
|
|
253
239
|
),
|
|
254
240
|
headers: jsonContentHeaders,
|
|
255
241
|
method: "POST",
|
|
@@ -267,10 +253,7 @@ class API extends API$1 {
|
|
|
267
253
|
exportSnapshotToObjectStorage = (request) => this.client.fetch(
|
|
268
254
|
{
|
|
269
255
|
body: JSON.stringify(
|
|
270
|
-
marshalExportSnapshotToObjectStorageRequest(
|
|
271
|
-
request,
|
|
272
|
-
this.client.settings
|
|
273
|
-
)
|
|
256
|
+
marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)
|
|
274
257
|
),
|
|
275
258
|
headers: jsonContentHeaders,
|
|
276
259
|
method: "POST",
|
|
@@ -283,10 +266,12 @@ class API extends API$1 {
|
|
|
283
266
|
*
|
|
284
267
|
* @param request - The request {@link DeleteSnapshotRequest}
|
|
285
268
|
*/
|
|
286
|
-
deleteSnapshot = (request) => this.client.fetch(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
269
|
+
deleteSnapshot = (request) => this.client.fetch(
|
|
270
|
+
{
|
|
271
|
+
method: "DELETE",
|
|
272
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
273
|
+
}
|
|
274
|
+
);
|
|
290
275
|
/**
|
|
291
276
|
* Update a snapshot. Update the name or tags of the snapshot.
|
|
292
277
|
*
|
|
@@ -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 { CreateSnapshotRequest, CreateVolumeRequest, CreateVolumeRequestFromEmpty, CreateVolumeRequestFromSnapshot, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse,
|
|
4
|
+
export type { CreateSnapshotRequest, CreateVolumeRequest, CreateVolumeRequestFromEmpty, CreateVolumeRequestFromSnapshot, DeleteSnapshotRequest, DeleteVolumeRequest, ExportSnapshotToObjectStorageRequest, GetSnapshotRequest, GetVolumeRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse, ListVolumesRequest, ListVolumesRequestOrderBy, ListVolumesResponse, ListVolumeTypesRequest, ListVolumeTypesResponse, Reference, ReferenceStatus, ReferenceType, Snapshot, SnapshotParentVolume, SnapshotStatus, StorageClass, UpdateSnapshotRequest, UpdateVolumeRequest, Volume, VolumeSpecifications, VolumeStatus, VolumeType, } 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 { CreateSnapshotRequest, CreateVolumeRequest, ExportSnapshotToObjectStorageRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsResponse,
|
|
2
|
+
import type { CreateSnapshotRequest, CreateVolumeRequest, ExportSnapshotToObjectStorageRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsResponse, ListVolumesResponse, ListVolumeTypesResponse, Snapshot, UpdateSnapshotRequest, UpdateVolumeRequest, Volume } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalSnapshot: (data: unknown) => Snapshot;
|
|
4
4
|
export declare const unmarshalVolume: (data: unknown) => Volume;
|
|
5
5
|
export declare const unmarshalListSnapshotsResponse: (data: unknown) => ListSnapshotsResponse;
|
|
@@ -153,12 +153,15 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
param: "from_snapshot",
|
|
156
|
-
value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(
|
|
157
|
-
request.fromSnapshot
|
|
158
|
-
) : void 0
|
|
156
|
+
value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : void 0
|
|
159
157
|
}
|
|
160
158
|
]),
|
|
161
|
-
...resolveOneOf([
|
|
159
|
+
...resolveOneOf([
|
|
160
|
+
{
|
|
161
|
+
param: "perf_iops",
|
|
162
|
+
value: request.perfIops
|
|
163
|
+
}
|
|
164
|
+
])
|
|
162
165
|
});
|
|
163
166
|
const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
|
|
164
167
|
bucket: request.bucket,
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-block",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK block",
|
|
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/block"
|
|
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": "
|
|
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