Skip to content

Commit 8ac82f9

Browse files
committed
feat(block): add volume wait command
1 parent 172349b commit 8ac82f9

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

cmd/scw/testdata/test-all-usage-block-volume-usage.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ AVAILABLE COMMANDS:
1212
list List volumes
1313
update Update a volume
1414

15+
WORKFLOW COMMANDS:
16+
wait Wait for volume to reach a stable state
17+
1518
FLAGS:
1619
-h, --help help for volume
1720

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Wait for volume to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the volume.
4+
5+
USAGE:
6+
scw block volume wait <volume-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Wait for a volume to be available
10+
scw block volume wait 11111111-1111-1111-1111-111111111111 terminal-status=available
11+
12+
ARGS:
13+
[timeout=5m0s] Timeout of the wait
14+
volume-id ID of the volume affected by the action.
15+
[terminal-status] Expected terminal status, will wait until this status is reached. (unknown_status | creating | available | in_use | deleting | deleted | resizing | error | snapshotting | locked | updating)
16+
[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)
17+
18+
FLAGS:
19+
-h, --help help for wait
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use

internal/namespaces/block/v1alpha1/custom.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ var (
4545
func GetCommands() *core.Commands {
4646
cmds := GetGeneratedCommands()
4747

48+
cmds.Add(volumeWaitCommand())
49+
4850
human.RegisterMarshalerFunc(block.VolumeStatus(""), human.EnumMarshalFunc(volumeStatusMarshalSpecs))
4951
human.RegisterMarshalerFunc(block.SnapshotStatus(""), human.EnumMarshalFunc(snapshotStatusMarshalSpecs))
5052
human.RegisterMarshalerFunc(block.ReferenceStatus(""), human.EnumMarshalFunc(referenceStatusMarshalSpecs))

0 commit comments

Comments
 (0)