Skip to content

Commit fb405c8

Browse files
feat(instance): add a generated name for create volume (#1917)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 656d3a6 commit fb405c8

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

cmd/scw/testdata/test-all-usage-instance-volume-create-usage.golden

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ EXAMPLES:
1616
scw instance volume create volume-type=l_ssd base-volume=00112233-4455-6677-8899-aabbccddeeff
1717

1818
ARGS:
19-
[name] The volume name
20-
[project-id] Project ID to use. If none is passed the default project ID will be used
21-
[volume-type] The volume type (l_ssd | b_ssd)
22-
[size] The volume disk size
23-
[base-volume] The ID of the volume on which this volume will be based
24-
[base-snapshot] The ID of the snapshot on which this volume will be based
25-
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
26-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1)
19+
[name=<generated>] The volume name
20+
[project-id] Project ID to use. If none is passed the default project ID will be used
21+
[volume-type] The volume type (l_ssd | b_ssd)
22+
[size] The volume disk size
23+
[base-volume] The ID of the volume on which this volume will be based
24+
[base-snapshot] The ID of the snapshot on which this volume will be based
25+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
26+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1)
2727

2828
FLAGS:
2929
-h, --help help for create

docs/commands/instance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ scw instance volume create [arg=value ...]
22222222

22232223
| Name | | Description |
22242224
|------|---|-------------|
2225-
| name | | The volume name |
2225+
| name | Default: `<generated>` | The volume name |
22262226
| project-id | | Project ID to use. If none is passed the default project ID will be used |
22272227
| volume-type | One of: `l_ssd`, `b_ssd` | The volume type |
22282228
| size | | The volume disk size |

internal/namespaces/instance/v1/instance_cli.go

+1
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,7 @@ func instanceVolumeCreate() *core.Command {
14701470
Required: false,
14711471
Deprecated: false,
14721472
Positional: false,
1473+
Default: core.RandomValueGenerator("vol"),
14731474
},
14741475
core.ProjectArgSpec(),
14751476
{

0 commit comments

Comments
 (0)