@scaleway/sdk-block 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +3 -6
- package/dist/v1/api.gen.js +193 -278
- package/dist/v1/content.gen.js +15 -16
- package/dist/v1/index.gen.js +23 -21
- package/dist/v1/marshalling.gen.js +116 -172
- package/dist/v1/validation-rules.gen.js +31 -51
- package/dist/v1alpha1/api.gen.js +208 -294
- package/dist/v1alpha1/content.gen.js +15 -16
- package/dist/v1alpha1/index.gen.js +23 -21
- package/dist/v1alpha1/marshalling.gen.js +123 -179
- package/dist/v1alpha1/validation-rules.gen.js +33 -57
- package/package.json +4 -4
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,295 +1,209 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a snapshot from a Scaleway Object Storage bucket
|
|
210
|
-
The bucket must contain a QCOW2 image.
|
|
211
|
-
The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
|
|
212
|
-
*
|
|
213
|
-
* @deprecated
|
|
214
|
-
* @param request - The request {@link ImportSnapshotFromS3Request}
|
|
215
|
-
* @returns A Promise of Snapshot
|
|
216
|
-
*/
|
|
217
|
-
importSnapshotFromS3 = (request) => this.client.fetch(
|
|
218
|
-
{
|
|
219
|
-
body: JSON.stringify(
|
|
220
|
-
marshalImportSnapshotFromS3Request(request, this.client.settings)
|
|
221
|
-
),
|
|
222
|
-
headers: jsonContentHeaders,
|
|
223
|
-
method: "POST",
|
|
224
|
-
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
|
|
225
|
-
},
|
|
226
|
-
unmarshalSnapshot
|
|
227
|
-
);
|
|
228
|
-
/**
|
|
229
|
-
* Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image.
|
|
230
|
-
The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
|
|
231
|
-
*
|
|
232
|
-
* @param request - The request {@link ImportSnapshotFromObjectStorageRequest}
|
|
233
|
-
* @returns A Promise of Snapshot
|
|
234
|
-
*/
|
|
235
|
-
importSnapshotFromObjectStorage = (request) => this.client.fetch(
|
|
236
|
-
{
|
|
237
|
-
body: JSON.stringify(
|
|
238
|
-
marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)
|
|
239
|
-
),
|
|
240
|
-
headers: jsonContentHeaders,
|
|
241
|
-
method: "POST",
|
|
242
|
-
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
|
|
243
|
-
},
|
|
244
|
-
unmarshalSnapshot
|
|
245
|
-
);
|
|
246
|
-
/**
|
|
247
|
-
* Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format.
|
|
248
|
-
The snapshot must not be in transient state.
|
|
249
|
-
*
|
|
250
|
-
* @param request - The request {@link ExportSnapshotToObjectStorageRequest}
|
|
251
|
-
* @returns A Promise of Snapshot
|
|
252
|
-
*/
|
|
253
|
-
exportSnapshotToObjectStorage = (request) => this.client.fetch(
|
|
254
|
-
{
|
|
255
|
-
body: JSON.stringify(
|
|
256
|
-
marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)
|
|
257
|
-
),
|
|
258
|
-
headers: jsonContentHeaders,
|
|
259
|
-
method: "POST",
|
|
260
|
-
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
|
|
261
|
-
},
|
|
262
|
-
unmarshalSnapshot
|
|
263
|
-
);
|
|
264
|
-
/**
|
|
265
|
-
* Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
|
|
266
|
-
*
|
|
267
|
-
* @param request - The request {@link DeleteSnapshotRequest}
|
|
268
|
-
*/
|
|
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
|
-
);
|
|
275
|
-
/**
|
|
276
|
-
* Update a snapshot. Update the name or tags of the snapshot.
|
|
277
|
-
*
|
|
278
|
-
* @param request - The request {@link UpdateSnapshotRequest}
|
|
279
|
-
* @returns A Promise of Snapshot
|
|
280
|
-
*/
|
|
281
|
-
updateSnapshot = (request) => this.client.fetch(
|
|
282
|
-
{
|
|
283
|
-
body: JSON.stringify(
|
|
284
|
-
marshalUpdateSnapshotRequest(request, this.client.settings)
|
|
285
|
-
),
|
|
286
|
-
headers: jsonContentHeaders,
|
|
287
|
-
method: "PATCH",
|
|
288
|
-
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
289
|
-
},
|
|
290
|
-
unmarshalSnapshot
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
export {
|
|
294
|
-
API
|
|
1
|
+
import { SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
|
+
import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotToObjectStorageRequest, marshalImportSnapshotFromObjectStorageRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume } from "./marshalling.gen.js";
|
|
3
|
+
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
|
+
/**
|
|
6
|
+
* Block Storage API.
|
|
7
|
+
|
|
8
|
+
This API allows you to manage your Block Storage volumes.
|
|
9
|
+
*/
|
|
10
|
+
var API$1 = class extends API {
|
|
11
|
+
/**
|
|
12
|
+
* Locality of this API.
|
|
13
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
14
|
+
*/
|
|
15
|
+
static LOCALITY = toApiLocality({ zones: [
|
|
16
|
+
"fr-par-1",
|
|
17
|
+
"fr-par-2",
|
|
18
|
+
"fr-par-3",
|
|
19
|
+
"nl-ams-1",
|
|
20
|
+
"nl-ams-2",
|
|
21
|
+
"nl-ams-3",
|
|
22
|
+
"pl-waw-1",
|
|
23
|
+
"pl-waw-2",
|
|
24
|
+
"pl-waw-3"
|
|
25
|
+
] });
|
|
26
|
+
pageOfListVolumeTypes = (request = {}) => this.client.fetch({
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`,
|
|
29
|
+
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
30
|
+
}, unmarshalListVolumeTypesResponse);
|
|
31
|
+
/**
|
|
32
|
+
* List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The request {@link ListVolumeTypesRequest}
|
|
35
|
+
* @returns A Promise of ListVolumeTypesResponse
|
|
36
|
+
*/
|
|
37
|
+
listVolumeTypes = (request = {}) => enrichForPagination("volumeTypes", this.pageOfListVolumeTypes, request);
|
|
38
|
+
pageOfListVolumes = (request = {}) => this.client.fetch({
|
|
39
|
+
method: "GET",
|
|
40
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
|
|
41
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["product_resource_id", request.productResourceId], ["project_id", request.projectId], ["tags", request.tags])
|
|
42
|
+
}, unmarshalListVolumesResponse);
|
|
43
|
+
/**
|
|
44
|
+
* List volumes. List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
45
|
+
*
|
|
46
|
+
* @param request - The request {@link ListVolumesRequest}
|
|
47
|
+
* @returns A Promise of ListVolumesResponse
|
|
48
|
+
*/
|
|
49
|
+
listVolumes = (request = {}) => enrichForPagination("volumes", this.pageOfListVolumes, request);
|
|
50
|
+
/**
|
|
51
|
+
* Create a volume. To create a new volume from scratch, you must specify `from_empty` and the `size`.
|
|
52
|
+
To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link CreateVolumeRequest}
|
|
55
|
+
* @returns A Promise of Volume
|
|
56
|
+
*/
|
|
57
|
+
createVolume = (request = {}) => this.client.fetch({
|
|
58
|
+
body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),
|
|
59
|
+
headers: jsonContentHeaders,
|
|
60
|
+
method: "POST",
|
|
61
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`
|
|
62
|
+
}, unmarshalVolume);
|
|
63
|
+
/**
|
|
64
|
+
* Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link GetVolumeRequest}
|
|
67
|
+
* @returns A Promise of Volume
|
|
68
|
+
*/
|
|
69
|
+
getVolume = (request) => this.client.fetch({
|
|
70
|
+
method: "GET",
|
|
71
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
72
|
+
}, unmarshalVolume);
|
|
73
|
+
/**
|
|
74
|
+
* Waits for {@link Volume} to be in a final state.
|
|
75
|
+
*
|
|
76
|
+
* @param request - The request {@link GetVolumeRequest}
|
|
77
|
+
* @param options - The waiting options
|
|
78
|
+
* @returns A Promise of Volume
|
|
79
|
+
*/
|
|
80
|
+
waitForVolume = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))), this.getVolume, request, options);
|
|
81
|
+
/**
|
|
82
|
+
* Delete a detached volume. You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.
|
|
83
|
+
*
|
|
84
|
+
* @param request - The request {@link DeleteVolumeRequest}
|
|
85
|
+
*/
|
|
86
|
+
deleteVolume = (request) => this.client.fetch({
|
|
87
|
+
method: "DELETE",
|
|
88
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* 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).
|
|
92
|
+
You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
|
|
93
|
+
*
|
|
94
|
+
* @param request - The request {@link UpdateVolumeRequest}
|
|
95
|
+
* @returns A Promise of Volume
|
|
96
|
+
*/
|
|
97
|
+
updateVolume = (request) => this.client.fetch({
|
|
98
|
+
body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),
|
|
99
|
+
headers: jsonContentHeaders,
|
|
100
|
+
method: "PATCH",
|
|
101
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
|
|
102
|
+
}, unmarshalVolume);
|
|
103
|
+
pageOfListSnapshots = (request = {}) => this.client.fetch({
|
|
104
|
+
method: "GET",
|
|
105
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
|
|
106
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags], ["volume_id", request.volumeId])
|
|
107
|
+
}, unmarshalListSnapshotsResponse);
|
|
108
|
+
/**
|
|
109
|
+
* List all snapshots. List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
110
|
+
*
|
|
111
|
+
* @param request - The request {@link ListSnapshotsRequest}
|
|
112
|
+
* @returns A Promise of ListSnapshotsResponse
|
|
113
|
+
*/
|
|
114
|
+
listSnapshots = (request = {}) => enrichForPagination("snapshots", this.pageOfListSnapshots, request);
|
|
115
|
+
/**
|
|
116
|
+
* Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
119
|
+
* @returns A Promise of Snapshot
|
|
120
|
+
*/
|
|
121
|
+
getSnapshot = (request) => this.client.fetch({
|
|
122
|
+
method: "GET",
|
|
123
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
124
|
+
}, unmarshalSnapshot);
|
|
125
|
+
/**
|
|
126
|
+
* Waits for {@link Snapshot} to be in a final state.
|
|
127
|
+
*
|
|
128
|
+
* @param request - The request {@link GetSnapshotRequest}
|
|
129
|
+
* @param options - The waiting options
|
|
130
|
+
* @returns A Promise of Snapshot
|
|
131
|
+
*/
|
|
132
|
+
waitForSnapshot = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
|
|
133
|
+
/**
|
|
134
|
+
* Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status.
|
|
135
|
+
If your volume is in a transient state, you need to wait until the end of the current operation.
|
|
136
|
+
*
|
|
137
|
+
* @param request - The request {@link CreateSnapshotRequest}
|
|
138
|
+
* @returns A Promise of Snapshot
|
|
139
|
+
*/
|
|
140
|
+
createSnapshot = (request) => this.client.fetch({
|
|
141
|
+
body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),
|
|
142
|
+
headers: jsonContentHeaders,
|
|
143
|
+
method: "POST",
|
|
144
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
|
|
145
|
+
}, unmarshalSnapshot);
|
|
146
|
+
/**
|
|
147
|
+
* (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a snapshot from a Scaleway Object Storage bucket
|
|
148
|
+
The bucket must contain a QCOW2 image.
|
|
149
|
+
The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
|
|
150
|
+
*
|
|
151
|
+
* @deprecated
|
|
152
|
+
* @param request - The request {@link ImportSnapshotFromS3Request}
|
|
153
|
+
* @returns A Promise of Snapshot
|
|
154
|
+
*/
|
|
155
|
+
importSnapshotFromS3 = (request) => this.client.fetch({
|
|
156
|
+
body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
|
|
157
|
+
headers: jsonContentHeaders,
|
|
158
|
+
method: "POST",
|
|
159
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
|
|
160
|
+
}, unmarshalSnapshot);
|
|
161
|
+
/**
|
|
162
|
+
* Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image.
|
|
163
|
+
The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
|
|
164
|
+
*
|
|
165
|
+
* @param request - The request {@link ImportSnapshotFromObjectStorageRequest}
|
|
166
|
+
* @returns A Promise of Snapshot
|
|
167
|
+
*/
|
|
168
|
+
importSnapshotFromObjectStorage = (request) => this.client.fetch({
|
|
169
|
+
body: JSON.stringify(marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)),
|
|
170
|
+
headers: jsonContentHeaders,
|
|
171
|
+
method: "POST",
|
|
172
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
|
|
173
|
+
}, unmarshalSnapshot);
|
|
174
|
+
/**
|
|
175
|
+
* Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format.
|
|
176
|
+
The snapshot must not be in transient state.
|
|
177
|
+
*
|
|
178
|
+
* @param request - The request {@link ExportSnapshotToObjectStorageRequest}
|
|
179
|
+
* @returns A Promise of Snapshot
|
|
180
|
+
*/
|
|
181
|
+
exportSnapshotToObjectStorage = (request) => this.client.fetch({
|
|
182
|
+
body: JSON.stringify(marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)),
|
|
183
|
+
headers: jsonContentHeaders,
|
|
184
|
+
method: "POST",
|
|
185
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
|
|
186
|
+
}, unmarshalSnapshot);
|
|
187
|
+
/**
|
|
188
|
+
* Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
|
|
189
|
+
*
|
|
190
|
+
* @param request - The request {@link DeleteSnapshotRequest}
|
|
191
|
+
*/
|
|
192
|
+
deleteSnapshot = (request) => this.client.fetch({
|
|
193
|
+
method: "DELETE",
|
|
194
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
195
|
+
});
|
|
196
|
+
/**
|
|
197
|
+
* Update a snapshot. Update the name or tags of the snapshot.
|
|
198
|
+
*
|
|
199
|
+
* @param request - The request {@link UpdateSnapshotRequest}
|
|
200
|
+
* @returns A Promise of Snapshot
|
|
201
|
+
*/
|
|
202
|
+
updateSnapshot = (request) => this.client.fetch({
|
|
203
|
+
body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
|
|
204
|
+
headers: jsonContentHeaders,
|
|
205
|
+
method: "PATCH",
|
|
206
|
+
path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
|
|
207
|
+
}, unmarshalSnapshot);
|
|
295
208
|
};
|
|
209
|
+
export { API$1 as API };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
+
/** Lists transient statutes of the enum {@link ReferenceStatus}. */
|
|
1
2
|
const REFERENCE_TRANSIENT_STATUSES = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
"attaching",
|
|
4
|
+
"detaching",
|
|
5
|
+
"creating"
|
|
5
6
|
];
|
|
7
|
+
/** Lists transient statutes of the enum {@link SnapshotStatus}. */
|
|
6
8
|
const SNAPSHOT_TRANSIENT_STATUSES = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
"creating",
|
|
10
|
+
"deleting",
|
|
11
|
+
"exporting"
|
|
10
12
|
];
|
|
13
|
+
/** Lists transient statutes of the enum {@link VolumeStatus}. */
|
|
11
14
|
const VOLUME_TRANSIENT_STATUSES = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
"creating",
|
|
16
|
+
"deleting",
|
|
17
|
+
"resizing",
|
|
18
|
+
"snapshotting",
|
|
19
|
+
"updating"
|
|
17
20
|
];
|
|
18
|
-
export {
|
|
19
|
-
REFERENCE_TRANSIENT_STATUSES,
|
|
20
|
-
SNAPSHOT_TRANSIENT_STATUSES,
|
|
21
|
-
VOLUME_TRANSIENT_STATUSES
|
|
22
|
-
};
|
|
21
|
+
export { REFERENCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES };
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { REFERENCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
3
|
import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotToObjectStorageRequest, marshalImportSnapshotFromObjectStorageRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume } from "./marshalling.gen.js";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
import { API } from "./api.gen.js";
|
|
5
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
6
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
API: () => API,
|
|
8
|
+
REFERENCE_TRANSIENT_STATUSES: () => REFERENCE_TRANSIENT_STATUSES,
|
|
9
|
+
SNAPSHOT_TRANSIENT_STATUSES: () => SNAPSHOT_TRANSIENT_STATUSES,
|
|
10
|
+
VOLUME_TRANSIENT_STATUSES: () => VOLUME_TRANSIENT_STATUSES,
|
|
11
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
12
|
+
marshalCreateSnapshotRequest: () => marshalCreateSnapshotRequest,
|
|
13
|
+
marshalCreateVolumeRequest: () => marshalCreateVolumeRequest,
|
|
14
|
+
marshalExportSnapshotToObjectStorageRequest: () => marshalExportSnapshotToObjectStorageRequest,
|
|
15
|
+
marshalImportSnapshotFromObjectStorageRequest: () => marshalImportSnapshotFromObjectStorageRequest,
|
|
16
|
+
marshalImportSnapshotFromS3Request: () => marshalImportSnapshotFromS3Request,
|
|
17
|
+
marshalUpdateSnapshotRequest: () => marshalUpdateSnapshotRequest,
|
|
18
|
+
marshalUpdateVolumeRequest: () => marshalUpdateVolumeRequest,
|
|
19
|
+
unmarshalListSnapshotsResponse: () => unmarshalListSnapshotsResponse,
|
|
20
|
+
unmarshalListVolumeTypesResponse: () => unmarshalListVolumeTypesResponse,
|
|
21
|
+
unmarshalListVolumesResponse: () => unmarshalListVolumesResponse,
|
|
22
|
+
unmarshalSnapshot: () => unmarshalSnapshot,
|
|
23
|
+
unmarshalVolume: () => unmarshalVolume
|
|
24
|
+
});
|
|
25
|
+
export { index_gen_exports };
|