File tree 3 files changed +6
-5
lines changed
packages/clients/src/api/block/v1alpha1 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ export class API extends ParentAPI {
143
143
* @param request - The request {@link CreateVolumeRequest}
144
144
* @returns A Promise of Volume
145
145
*/
146
- createVolume = ( request : Readonly < CreateVolumeRequest > ) =>
146
+ createVolume = ( request : Readonly < CreateVolumeRequest > = { } ) =>
147
147
this . client . fetch < Volume > (
148
148
{
149
149
body : JSON . stringify (
Original file line number Diff line number Diff line change 1
1
// This file was automatically generated. DO NOT EDIT.
2
2
// If you have any remark or suggestion do not hesitate to open an issue.
3
+ import randomName from '@scaleway/random-name'
3
4
import {
4
5
isJSONObject ,
5
6
resolveOneOf ,
@@ -190,7 +191,7 @@ export const marshalCreateSnapshotRequest = (
190
191
request : CreateSnapshotRequest ,
191
192
defaults : DefaultValues ,
192
193
) : Record < string , unknown > => ( {
193
- name : request . name ,
194
+ name : request . name || randomName ( 'snp' ) ,
194
195
project_id : request . projectId ?? defaults . defaultProjectId ,
195
196
tags : request . tags ,
196
197
volume_id : request . volumeId ,
@@ -215,7 +216,7 @@ export const marshalCreateVolumeRequest = (
215
216
request : CreateVolumeRequest ,
216
217
defaults : DefaultValues ,
217
218
) : Record < string , unknown > => ( {
218
- name : request . name ,
219
+ name : request . name || randomName ( 'vol' ) ,
219
220
project_id : request . projectId ?? defaults . defaultProjectId ,
220
221
tags : request . tags ,
221
222
...resolveOneOf ( [
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export type CreateSnapshotRequest = {
191
191
/** UUID of the volume to snapshot. */
192
192
volumeId : string
193
193
/** Name of the snapshot. */
194
- name : string
194
+ name ? : string
195
195
/** UUID of the project to which the volume and the snapshot belong. */
196
196
projectId ?: string
197
197
/** List of tags assigned to the snapshot. */
@@ -202,7 +202,7 @@ export type CreateVolumeRequest = {
202
202
/** Zone to target. If none is passed will use default zone from the config. */
203
203
zone ?: Zone
204
204
/** Name of the volume. */
205
- name : string
205
+ name ? : string
206
206
/**
207
207
* The maximum IO/s expected, according to the different options available in
208
208
* stock (`5000 | 15000`).
You can’t perform that action at this time.
0 commit comments