Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(baremetal): add boot type in start server #1291

Merged
merged 1 commit into from
Jul 27, 2020
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
Expand Up @@ -13,12 +13,15 @@ EXAMPLES:
scw baremetal server create name=foo tags.0=prod tags.1=blue type=GP-BM1-M

ARGS:
name=<generated> Name of the server (≠hostname)
[description] Description associated to the server, max 255 characters
[type=GP-BM1-S] Server commercial type (GP-BM1-L | GP-BM1-M | GP-BM1-S | HC-BM1-L | HC-BM1-S | HM-BM1-XL | HM-BM1-M)
[tags.{index}] Tags to associate to the server
[organization-id] Organization ID to use. If none is passed will use default organization ID from the config
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-2)
name=<generated> Name of the server (≠hostname)
[description] Description associated to the server, max 255 characters
[type=GP-BM1-S] Server commercial type (GP-BM1-L | GP-BM1-M | GP-BM1-S | HC-BM1-L | HC-BM1-S | HM-BM1-XL | HM-BM1-M)
[tags.{index}] Tags to associate to the server
[install.os-id]
[install.hostname]
[install.ssh-key-ids.{index}]
[organization-id] Organization ID to use. If none is passed will use default organization ID from the config
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-2)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ EXAMPLES:
Start a baremetal server
scw baremetal server start 11111111-1111-1111-1111-111111111111

Start a server in rescue mode
scw baremetal server start 11111111-1111-1111-1111-111111111111

ARGS:
server-id ID of the server to start
[boot-type] The type of boot (unknown_boot_type | normal | rescue)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-2)

FLAGS:
Expand Down
26 changes: 26 additions & 0 deletions internal/namespaces/baremetal/v1/baremetal_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,21 @@ func baremetalServerCreate() *core.Command {
Required: false,
Positional: false,
},
{
Name: "install.os-id",
Required: false,
Positional: false,
},
{
Name: "install.hostname",
Required: false,
Positional: false,
},
{
Name: "install.ssh-key-ids.{index}",
Required: false,
Positional: false,
},
core.OrganizationIDArgSpec(),
core.ZoneArgSpec(scw.ZoneFrPar2),
},
Expand Down Expand Up @@ -417,6 +432,13 @@ func baremetalServerStart() *core.Command {
Required: true,
Positional: true,
},
{
Name: "boot-type",
Short: `The type of boot`,
Required: false,
Positional: false,
EnumValues: []string{"unknown_boot_type", "normal", "rescue"},
},
core.ZoneArgSpec(scw.ZoneFrPar2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand All @@ -432,6 +454,10 @@ func baremetalServerStart() *core.Command {
Short: "Start a baremetal server",
ArgsJSON: `{"server_id":"11111111-1111-1111-1111-111111111111"}`,
},
{
Short: "Start a server in rescue mode",
ArgsJSON: `{"boot_type":"rescue","server_id":"11111111-1111-1111-1111-111111111111"}`,
},
},
}
}
Expand Down