Skip to content

Commit 61920a7

Browse files
authored
feat(block): add commands (#3505)
1 parent a80306a commit 61920a7

19 files changed

+656
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
To create a snapshot, the volume must be in the `in_use` or the `available` status.
4+
If your volume is in a transient state, you need to wait until the end of the current operation.
5+
6+
USAGE:
7+
scw block snapshot create [arg=value ...]
8+
9+
ARGS:
10+
[volume-id] UUID of the volume to snapshot
11+
[name] Name of the snapshot
12+
[project-id] Project ID to use. If none is passed the default project ID will be used
13+
[tags.{index}] List of tags assigned to the snapshot
14+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
15+
16+
FLAGS:
17+
-h, --help help for create
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
4+
5+
USAGE:
6+
scw block snapshot delete [arg=value ...]
7+
8+
ARGS:
9+
snapshot-id UUID of the snapshot
10+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.
4+
5+
USAGE:
6+
scw block snapshot get <snapshot-id ...> [arg=value ...]
7+
8+
ARGS:
9+
snapshot-id UUID of the snapshot
10+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
11+
12+
FLAGS:
13+
-h, --help help for get
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
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.
4+
5+
USAGE:
6+
scw block snapshot list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Criteria to use when ordering the list (created_at_asc | created_at_desc | name_asc | name_desc)
10+
[project-id] Filter by Project ID
11+
[volume-id] Filter snapshots by the ID of the original volume
12+
[name] Filter snapshots by their names
13+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
14+
15+
FLAGS:
16+
-h, --help help for list
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Update the name or tags of the snapshot.
4+
5+
USAGE:
6+
scw block snapshot update <snapshot-id ...> [arg=value ...]
7+
8+
ARGS:
9+
snapshot-id UUID of the snapshot
10+
[name] When defined, is the name of the snapshot
11+
[tags.{index}] List of tags assigned to the snapshot
12+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
13+
14+
FLAGS:
15+
-h, --help help for update
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
You can then revert your data to the previous snapshot. You can also create a new read/write Block volume from a previous snapshot.
4+
5+
USAGE:
6+
scw block snapshot <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create a snapshot of a volume
10+
delete Delete a snapshot
11+
get Get a snapshot
12+
list List all snapshots
13+
update Update a snapshot
14+
15+
FLAGS:
16+
-h, --help help for snapshot
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
23+
24+
Use "scw block snapshot [command] --help" for more information about a command.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
This API allows you to use and manage your Block Storage volumes.
4+
5+
USAGE:
6+
scw block <command>
7+
8+
AVAILABLE COMMANDS:
9+
snapshot A Block Storage snapshot is a read-only picture of a Block volume, taken at a specific time
10+
volume A Block Storage volume is a logical storage drive on a network-connected storage system. It is exposed to Instances as if it were a physical disk, and can be attached and detached like a hard drive. Several Block volumes can be attached to one Instance at a time
11+
volume-type Block Storage volume types are determined by their storage class and their IOPS. There are two storage classes available: `bssd` and `sbs`. The IOPS can be chosen for volumes of the `sbs` storage class
12+
13+
FLAGS:
14+
-h, --help help for block
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
21+
22+
Use "scw block [command] --help" for more information about a command.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
To create a new volume from scratch, you must specify `from_empty` and the `size`.
4+
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.
5+
6+
USAGE:
7+
scw block volume create [arg=value ...]
8+
9+
ARGS:
10+
name Name of the volume
11+
perf-iops The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`)
12+
[project-id] Project ID to use. If none is passed the default project ID will be used
13+
[from-empty.size] Volume size in bytes, with a granularity of 1 GB (10^9 bytes)
14+
[from-snapshot.size] Volume size in bytes, with a granularity of 1 GB (10^9 bytes)
15+
[from-snapshot.snapshot-id] Source snapshot from which volume will be created
16+
[tags.{index}] List of tags assigned to the volume
17+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
18+
19+
FLAGS:
20+
-h, --help help for create
21+
22+
GLOBAL FLAGS:
23+
-c, --config string The path to the config file
24+
-D, --debug Enable debug mode
25+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
26+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.
4+
5+
USAGE:
6+
scw block volume delete [arg=value ...]
7+
8+
ARGS:
9+
volume-id UUID of the volume
10+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.
4+
5+
USAGE:
6+
scw block volume get <volume-id ...> [arg=value ...]
7+
8+
ARGS:
9+
volume-id UUID of the volume
10+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
11+
12+
FLAGS:
13+
-h, --help help for get
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
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.
4+
5+
USAGE:
6+
scw block volume list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Criteria to use when ordering the list (created_at_asc | created_at_desc | name_asc | name_desc)
10+
[project-id] Filter by Project ID
11+
[name] Filter the return volumes by their names
12+
[product-resource-id] Filter by a product resource ID linked to this volume (such as an Instance ID)
13+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
14+
15+
FLAGS:
16+
-h, --help help for list
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
4+
5+
USAGE:
6+
scw block volume-type list [arg=value ...]
7+
8+
ARGS:
9+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
10+
11+
FLAGS:
12+
-h, --help help for list
13+
14+
GLOBAL FLAGS:
15+
-c, --config string The path to the config file
16+
-D, --debug Enable debug mode
17+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
18+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Block Storage volume types are determined by their storage class and their IOPS. There are two storage classes available: `bssd` and `sbs`. The IOPS can be chosen for volumes of the `sbs` storage class.
4+
5+
USAGE:
6+
scw block volume-type <command>
7+
8+
AVAILABLE COMMANDS:
9+
list List volume types
10+
11+
FLAGS:
12+
-h, --help help for volume-type
13+
14+
GLOBAL FLAGS:
15+
-c, --config string The path to the config file
16+
-D, --debug Enable debug mode
17+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
18+
-p, --profile string The config profile to use
19+
20+
Use "scw block volume-type [command] --help" for more information about a command.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
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).
4+
You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
5+
6+
USAGE:
7+
scw block volume update <volume-id ...> [arg=value ...]
8+
9+
ARGS:
10+
volume-id UUID of the volume
11+
[name] When defined, is the new name of the volume
12+
[size] Optional field for increasing the size of a volume (size must be equal or larger than the current one)
13+
[tags.{index}] List of tags assigned to the volume
14+
[perf-iops] The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`)
15+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3)
16+
17+
FLAGS:
18+
-h, --help help for update
19+
20+
GLOBAL FLAGS:
21+
-c, --config string The path to the config file
22+
-D, --debug Enable debug mode
23+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
24+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Block volumes can be snapshotted, mounted or unmounted.
4+
5+
USAGE:
6+
scw block volume <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create a volume
10+
delete Delete a detached volume
11+
get Get a volume
12+
list List volumes
13+
update Update a volume
14+
15+
FLAGS:
16+
-h, --help help for volume
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
23+
24+
Use "scw block volume [command] --help" for more information about a command.

cmd/scw/testdata/test-main-usage-usage.golden

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ AVAILABLE COMMANDS:
99
autocomplete Autocomplete related commands
1010
baremetal Elastic Metal API
1111
billing This API allows you to query your consumption
12+
block This API allows you to use and manage your Block Storage volumes
1213
cockpit Cockpit API
1314
container Container as a Service API
1415
dns Domains and DNS API

0 commit comments

Comments
 (0)