Skip to content

Commit

Permalink
feat(block): improve arguments configuration (#4275)
Browse files Browse the repository at this point in the history
Co-authored-by: Jules Castéran <jcasteran@scaleway.com>
  • Loading branch information
scaleway-bot and Codelax authored Nov 18, 2024
1 parent 8f0a8ea commit d386384
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ USAGE:
scw block snapshot create [arg=value ...]

ARGS:
[volume-id] UUID of the volume to snapshot
[name] Name of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] List of tags assigned to the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
[volume-id] UUID of the volume to snapshot
[name=<generated>] Name of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] List of tags assigned to the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.

USAGE:
scw block snapshot delete [arg=value ...]
scw block snapshot delete <snapshot-id ...> [arg=value ...]

ARGS:
snapshot-id UUID of the snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:
scw block volume create [arg=value ...]

ARGS:
name Name of the volume
name=<generated> Name of the volume
perf-iops The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`)
[project-id] Project ID to use. If none is passed the default project ID will be used
[from-empty.size] Volume size in bytes, with a granularity of 1 GB (10^9 bytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.

USAGE:
scw block volume delete [arg=value ...]
scw block volume delete <volume-id ...> [arg=value ...]

ARGS:
volume-id UUID of the volume
Expand Down
8 changes: 4 additions & 4 deletions docs/commands/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ scw block snapshot create [arg=value ...]
| Name | | Description |
|------|---|-------------|
| volume-id | | UUID of the volume to snapshot |
| name | | Name of the snapshot |
| name | Default: `<generated>` | Name of the snapshot |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| tags.{index} | | List of tags assigned to the snapshot |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
Expand All @@ -56,7 +56,7 @@ You must specify the `snapshot_id` of the snapshot you want to delete. The snaps
**Usage:**

```
scw block snapshot delete [arg=value ...]
scw block snapshot delete <snapshot-id ...> [arg=value ...]
```


Expand Down Expand Up @@ -205,7 +205,7 @@ scw block volume create [arg=value ...]

| Name | | Description |
|------|---|-------------|
| name | Required | Name of the volume |
| name | Required<br />Default: `<generated>` | Name of the volume |
| perf-iops | Required | The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`) |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| from-empty.size | | Volume size in bytes, with a granularity of 1 GB (10^9 bytes) |
Expand All @@ -223,7 +223,7 @@ You must specify the `volume_id` of the volume you want to delete. The volume mu
**Usage:**

```
scw block volume delete [arg=value ...]
scw block volume delete <volume-id ...> [arg=value ...]
```


Expand Down
6 changes: 4 additions & 2 deletions internal/namespaces/block/v1alpha1/block_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ To create a volume from an existing snapshot, specify ` + "`" + `from_snapshot`
Required: true,
Deprecated: false,
Positional: false,
Default: core.RandomValueGenerator("vol"),
},
{
Name: "perf-iops",
Expand Down Expand Up @@ -292,7 +293,7 @@ func blockVolumeDelete() *core.Command {
Short: `UUID of the volume`,
Required: true,
Deprecated: false,
Positional: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Expand Down Expand Up @@ -494,6 +495,7 @@ If your volume is in a transient state, you need to wait until the end of the cu
Required: false,
Deprecated: false,
Positional: false,
Default: core.RandomValueGenerator("snp"),
},
core.ProjectIDArgSpec(),
{
Expand Down Expand Up @@ -636,7 +638,7 @@ func blockSnapshotDelete() *core.Command {
Short: `UUID of the snapshot`,
Required: true,
Deprecated: false,
Positional: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Expand Down

0 comments on commit d386384

Please sign in to comment.