Skip to content

Commit 4202466

Browse files
authored
doc: add examples on instance namespace (#725)
1 parent a111d12 commit 4202466

19 files changed

+317
-6
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Create image.
33
USAGE:
44
scw [global-flags] instance image create [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Create an image named 'foobar' for x86_64 instances from the given root_volume ID (root_volume ID needs to be a snapshot UUID)
8+
scw instance image create
9+
610
ARGS:
711
[name=<generated>] Name of the image
812
snapshot-id UUID of the snapshot

cmd/scw/testdata/test-all-usage-instance-image-delete-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Delete the image with the given ID.
33
USAGE:
44
scw [global-flags] instance image delete [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Delete an image in the default zone with the given ID
8+
scw instance image delete image-id=11111111-1111-1111-1111-111111111111
9+
10+
Delete an image in fr-par-1 zone with the given ID
11+
scw instance image delete zone=fr-par-1 image-id=11111111-1111-1111-1111-111111111111
12+
613
ARGS:
714
image-id
815
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-image-get-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Get details of an image with the given ID.
33
USAGE:
44
scw [global-flags] instance image get [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Get an image in the default zone with the given ID
8+
scw instance image get image-id=11111111-1111-1111-1111-111111111111
9+
10+
Get an image in fr-par-1 zone with the given ID
11+
scw instance image get zone=fr-par-1 image-id=11111111-1111-1111-1111-111111111111
12+
613
ARGS:
714
image-id
815
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-image-list-usage.stderr.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ USAGE:
44
scw [global-flags] instance image list [flags] [arg=value ...]
55

66
EXAMPLES:
7-
List all public images in your default zone
7+
List all public images in the default zone
88
scw instance image list
99

1010
ARGS:

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

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Reserve an IP.
33
USAGE:
44
scw [global-flags] instance ip create [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Create an IP in the default zone
8+
scw instance ip create
9+
10+
Create an IP in fr-par-1 zone
11+
scw instance ip create zone=fr-par-1
12+
13+
Create an IP and attach it to the given server
14+
scw instance ip create server=11111111-1111-1111-1111-111111111111
15+
616
ARGS:
717
[server] UUID of the server you want to attach the IP to
818
[tags.{index}] An array of keywords you want to tag this IP with

cmd/scw/testdata/test-all-usage-instance-ip-delete-usage.stderr.golden

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Delete the IP with the given ID.
33
USAGE:
44
scw [global-flags] instance ip delete [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Delete an IP in the default zone with the given ID
8+
scw instance ip delete ip=11111111-1111-1111-1111-111111111111
9+
10+
Delete an IP in fr-par-1 zone with the given ID
11+
scw instance ip delete zone=fr-par-1 ip=11111111-1111-1111-1111-111111111111
12+
13+
Delete an IP using directly the given IP address
14+
scw instance ip delete ip=51.15.253.183
15+
616
ARGS:
717
ip The ID or the address of the IP to delete
818
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-ip-get-usage.stderr.golden

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Get details of an IP with the given ID or address.
33
USAGE:
44
scw [global-flags] instance ip get [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Get an IP in the default zone with the given ID
8+
scw instance ip get ip=11111111-1111-1111-1111-111111111111
9+
10+
Get an IP in fr-par-1 zone with the given ID
11+
scw instance ip get zone=fr-par-1 ip=11111111-1111-1111-1111-111111111111
12+
13+
Get an IP using directly the given IP address
14+
scw instance ip get
15+
616
ARGS:
717
ip The IP ID or address to get
818
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-ip-list-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ List IPs.
33
USAGE:
44
scw [global-flags] instance ip list [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
List all IPs in the default zone
8+
scw instance ip list
9+
10+
List all IPs in fr-par-1 zone
11+
scw instance ip list zone=fr-par-1
12+
613
ARGS:
714
[name] Filter on the IP address (Works as a LIKE operation on the IP address)
815
[organization] The organization ID the IPs are reserved in

cmd/scw/testdata/test-all-usage-instance-ip-update-usage.stderr.golden

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Update IP.
33
USAGE:
44
scw [global-flags] instance ip update [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Update an IP in the default zone with the given ID
8+
scw instance ip update ip=11111111-1111-1111-1111-111111111111 reverse=example.com
9+
10+
Update an IP in fr-par-1 zone with the given ID
11+
scw instance ip update zone=fr-par-1 ip=11111111-1111-1111-1111-111111111111 reverse=example.com
12+
13+
Update an IP using directly the given IP address
14+
scw instance ip update ip=51.15.253.183 reverse=example.com
15+
616
ARGS:
717
ip IP ID or IP address
818
[reverse] Reverse domain name

cmd/scw/testdata/test-all-usage-instance-placement-group-delete-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Delete the given placement group.
33
USAGE:
44
scw [global-flags] instance placement-group delete [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Delete a placement group in the default zone with the given ID
8+
scw instance placement-group delete placement-group-id=11111111-1111-1111-1111-111111111111
9+
10+
Delete a placement group in fr-par-1 zone with the given ID
11+
scw instance placement-group delete zone=fr-par-1 placement-group-id=11111111-1111-1111-1111-111111111111
12+
613
ARGS:
714
placement-group-id
815
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-placement-group-list-usage.stderr.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ USAGE:
44
scw [global-flags] instance placement-group list [flags] [arg=value ...]
55

66
EXAMPLES:
7-
List all placement groups in your default zone
7+
List all placement groups in the default zone
88
scw instance placement-group list
99

1010
List placement groups that match a given name ('cluster1' will return 'cluster100' and 'cluster1' but not 'foo')

cmd/scw/testdata/test-all-usage-instance-server-type-list-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Get server types technical details.
33
USAGE:
44
scw [global-flags] instance server-type list [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
List all server-types in the default zone
8+
scw instance server-type list
9+
10+
List all server-types in fr-par-1 zone
11+
scw instance server-type list zone=fr-par-1
12+
613
ARGS:
714
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)
815

cmd/scw/testdata/test-all-usage-instance-server-update-usage.stderr.golden

+19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ Update server.
33
USAGE:
44
scw [global-flags] instance server update [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Update the name of a given server
8+
scw instance server update
9+
10+
Put a given instance in rescue mode (reboot is required to access rescue mode)
11+
scw instance server update
12+
13+
Overwrite tags of a given server
14+
scw instance server update
15+
16+
Enable IPv6 on a given server
17+
scw instance server update
18+
19+
Apply the given security group to a given server
20+
scw instance server update
21+
22+
Put a given server in the given placement group. Server must be off
23+
scw instance server update
24+
625
ARGS:
726
server-id UUID of the server
827
[name] Name of the server

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

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Create snapshot.
33
USAGE:
44
scw [global-flags] instance snapshot create [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Create a snapshot in the default zone from the given volume ID
8+
scw instance snapshot create volume-id=11111111-1111-1111-1111-111111111111
9+
10+
Create a snapshot in fr-par-1 zone from the given volume ID
11+
scw instance snapshot create zone=fr-par-1 volume-id=11111111-1111-1111-1111-111111111111
12+
13+
Create a named snapshot from the given volume ID
14+
scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-111111111111
15+
616
ARGS:
717
[name=<generated>] Name of the snapshot
818
volume-id UUID of the volume

cmd/scw/testdata/test-all-usage-instance-snapshot-delete-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Delete the snapshot with the given ID.
33
USAGE:
44
scw [global-flags] instance snapshot delete [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Delete a snapshot in the default zone with the given ID
8+
scw instance snapshot delete snapshot-id=11111111-1111-1111-1111-111111111111
9+
10+
Delete a snapshot in fr-par-1 zone with the given ID
11+
scw instance snapshot delete zone=fr-par-1 snapshot-id=11111111-1111-1111-1111-111111111111
12+
613
ARGS:
714
snapshot-id
815
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-snapshot-get-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Get details of a snapshot with the given ID.
33
USAGE:
44
scw [global-flags] instance snapshot get [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
Get a snapshot in the default zone with the given ID
8+
scw instance snapshot get snapshot-id=11111111-1111-1111-1111-111111111111
9+
10+
Get a snapshot in fr-par-1 zone with the given ID
11+
scw instance snapshot get zone=fr-par-1 snapshot-id=11111111-1111-1111-1111-111111111111
12+
613
ARGS:
714
snapshot-id
815
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

cmd/scw/testdata/test-all-usage-instance-snapshot-list-usage.stderr.golden

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ List snapshots.
33
USAGE:
44
scw [global-flags] instance snapshot list [flags] [arg=value ...]
55

6+
EXAMPLES:
7+
List all snapshots in the default zone
8+
scw instance snapshot list
9+
10+
List all snapshots in fr-par-1 zone
11+
scw instance snapshot list zone=fr-par-1
12+
613
ARGS:
714
[name]
815
[organization]

cmd/scw/testdata/test-all-usage-instance-usage.stderr.golden

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ USAGE:
44
scw [global-flags] instance <command> [flags]
55

66
AVAILABLE COMMANDS:
7-
image An image is a backups of an instance
7+
image An image is a backup of an instance
88
ip A flexible IP address is an IP address which holden independently of any server
99
placement-group A placement group allows to express a preference regarding the physical position of a group of instances
1010
placement-group-server A placement group allows to express a preference regarding the physical position of a group of instances

0 commit comments

Comments
 (0)