-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(instance): add terminate command (#998)
This command uses the server action API: with `action=terminate` https://developers.scaleway.com/en/products/instance/api/#post-049a5b to quickly delete an instance without backing up its attached volumes. Options: * `with-ip`: also delete the flexible IPs * `with-block`: by default, `terminate` will delete the block storage volumes. When `false`, the command will detach the block volumes before calling `terminate` * prompt user by default when terminating an instance with at least 1 block volume * Check IP
- Loading branch information
Showing
17 changed files
with
7,983 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
cmd/scw/testdata/test-all-usage-instance-server-terminate-usage.stderr.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Terminates a server with the given ID and all of its volumes. | ||
|
||
USAGE: | ||
scw instance server terminate <server-id ...> [arg=value ...] | ||
|
||
EXAMPLES: | ||
Terminate a server in the default zone with a given id | ||
scw instance server terminate 11111111-1111-1111-1111-111111111111 | ||
|
||
Terminate a server in fr-par-1 zone with a given id | ||
scw instance server terminate 11111111-1111-1111-1111-111111111111 zone=fr-par-1 | ||
|
||
Terminate a server and also delete its flexible IPs | ||
scw instance server terminate 11111111-1111-1111-1111-111111111111 with-ip=true | ||
|
||
ARGS: | ||
server-id | ||
[with-ip] Delete the IP attached to the server | ||
[with-block=prompt] Delete the Block Storage volumes attached to the server (prompt | true | false) | ||
[zone] Zone to target. If none is passed will use default zone from the config | ||
|
||
FLAGS: | ||
-h, --help help for terminate | ||
|
||
GLOBAL FLAGS: | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human | ||
-p, --profile string The config profile to use | ||
|
||
SEE ALSO: | ||
# delete a running server | ||
scw instance server delete | ||
|
||
# Stop a running server | ||
scw instance server stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.