Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:
* the CPU architecture
* the OS type
* the required l_ssd storage size
* the required scratch storage size
If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned.

USAGE:
scw instance server get-compatible-types <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the Instance you want to get
[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 get-compatible-types

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
--web open console page for the current ressource
45 changes: 23 additions & 22 deletions cmd/scw/testdata/test-all-usage-instance-server-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,31 @@ USAGE:
scw instance server <command>

AVAILABLE COMMANDS:
action Perform a raw API action on a server
attach-ip Attach an IP to a server
attach-volume Attach a volume to a server
backup Backup server
console Connect to the serial console of an instance
create Create server
delete Delete server
detach-ip Detach an IP from a server
detach-volume Detach a volume from its server
enable-routed-ip Migrate server to IP mobility
get Get an Instance
get-rdp-password Get your server rdp password and decrypt it using your ssh key
list List all Instances
list-actions List Instance actions
reboot Reboot server
ssh SSH into a server
standby Put server in standby mode
start Power on server
stop Power off server
terminate Terminate server
update Update an Instance
action Perform a raw API action on a server
attach-ip Attach an IP to a server
attach-volume Attach a volume to a server
backup Backup server
console Connect to the serial console of an instance
create Create server
delete Delete server
detach-ip Detach an IP from a server
detach-volume Detach a volume from its server
enable-routed-ip Migrate server to IP mobility
get Get an Instance
get-compatible-types Get Instance compatible types
get-rdp-password Get your server rdp password and decrypt it using your ssh key
list List all Instances
list-actions List Instance actions
reboot Reboot server
ssh SSH into a server
standby Put server in standby mode
start Power on server
stop Power off server
terminate Terminate server
update Update an Instance

WORKFLOW COMMANDS:
wait Wait for server to reach a stable state
wait Wait for server to reach a stable state

FLAGS:
-h, --help help for server
Expand Down
26 changes: 26 additions & 0 deletions docs/commands/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ This API allows you to manage your Instances.
- [Detach a volume from its server](#detach-a-volume-from-its-server)
- [Migrate server to IP mobility](#migrate-server-to-ip-mobility)
- [Get an Instance](#get-an-instance)
- [Get Instance compatible types](#get-instance-compatible-types)
- [Get your server rdp password and decrypt it using your ssh key](#get-your-server-rdp-password-and-decrypt-it-using-your-ssh-key)
- [List all Instances](#list-all-instances)
- [List Instance actions](#list-instance-actions)
Expand Down Expand Up @@ -1941,6 +1942,31 @@ scw instance server get 94ededdf-358d-4019-9886-d754f8a2e78d



### Get Instance compatible types

Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:
* the CPU architecture
* the OS type
* the required l_ssd storage size
* the required scratch storage size
If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned.

**Usage:**

```
scw instance server get-compatible-types <server-id ...> [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the Instance you want to get |
| 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 |



### Get your server rdp password and decrypt it using your ssh key


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250303152806-55c4ed050ada
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da h1:2l4es/nkKYzsuMQl4JnrJDBCZKM+yfBzVlr5SpuajaU=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250303152806-55c4ed050ada h1:jY2pM9GG2D3xSAtE73+CNuHEjyhTW0XhN5fU4CMdWIM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250303152806-55c4ed050ada/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
36 changes: 36 additions & 0 deletions internal/namespaces/instance/v1/instance_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func GetGeneratedCommands() *core.Commands {
instanceUserDataDelete(),
instanceUserDataSet(),
instanceUserDataGet(),
instanceServerGetCompatibleTypes(),
instanceImageList(),
instanceImageGet(),
instanceImageCreate(),
Expand Down Expand Up @@ -958,6 +959,41 @@ func instanceUserDataGet() *core.Command {
}
}

func instanceServerGetCompatibleTypes() *core.Command {
return &core.Command{
Short: `Get Instance compatible types`,
Long: `Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:
* the CPU architecture
* the OS type
* the required l_ssd storage size
* the required scratch storage size
If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned.`,
Namespace: "instance",
Resource: "server",
Verb: "get-compatible-types",
// Deprecated: false,
ArgsType: reflect.TypeOf(instance.GetServerCompatibleTypesRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "server-id",
Short: `UUID of the Instance you want to get`,
Required: true,
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*instance.GetServerCompatibleTypesRequest)

client := core.ExtractClient(ctx)
api := instance.NewAPI(client)
return api.GetServerCompatibleTypes(request)

},
}
}

func instanceImageList() *core.Command {
return &core.Command{
Short: `List Instance images`,
Expand Down
Loading