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,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.

USAGE:
scw baremetal server update-ip [arg=value ...]

ARGS:
server-id ID of the server
ip-id ID of the IP to update
[reverse] New reverse IP to update, not updated if null
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1)

FLAGS:
-h, --help help for update-ip

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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ AVAILABLE COMMANDS:
start Start an Elastic Metal server
stop Stop an Elastic Metal server
update Update an Elastic Metal server
update-ip Update IP

WORKFLOW COMMANDS:
wait Wait for a server to reach a stable state (delivery and installation)
Expand Down
23 changes: 23 additions & 0 deletions docs/commands/baremetal.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Elastic Metal API.
- [Start an Elastic Metal server](#start-an-elastic-metal-server)
- [Stop an Elastic Metal server](#stop-an-elastic-metal-server)
- [Update an Elastic Metal server](#update-an-elastic-metal-server)
- [Update IP](#update-ip)
- [Wait for a server to reach a stable state (delivery and installation)](#wait-for-a-server-to-reach-a-stable-state-(delivery-and-installation))
- [Settings management commands](#settings-management-commands)
- [List all settings](#list-all-settings)
Expand Down Expand Up @@ -824,6 +825,28 @@ scw baremetal server update <server-id ...> [arg=value ...]



### Update IP

Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.

**Usage:**

```
scw baremetal server update-ip [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | ID of the server |
| ip-id | Required | ID of the IP to update |
| reverse | | New reverse IP to update, not updated if null |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |



### Wait for a server to reach a stable state (delivery and installation)

Wait for a server to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the server.
Expand Down
45 changes: 45 additions & 0 deletions internal/namespaces/baremetal/v1/baremetal_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func GetGeneratedCommands() *core.Commands {
baremetalBmcStart(),
baremetalBmcGet(),
baremetalBmcStop(),
baremetalServerUpdateIP(),
baremetalOptionsAdd(),
baremetalOptionsDelete(),
baremetalOfferList(),
Expand Down Expand Up @@ -885,6 +886,50 @@ func baremetalBmcStop() *core.Command {
}
}

func baremetalServerUpdateIP() *core.Command {
return &core.Command{
Short: `Update IP`,
Long: `Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.`,
Namespace: "baremetal",
Resource: "server",
Verb: "update-ip",
// Deprecated: false,
ArgsType: reflect.TypeOf(baremetal.UpdateIPRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "server-id",
Short: `ID of the server`,
Required: true,
Deprecated: false,
Positional: false,
},
{
Name: "ip-id",
Short: `ID of the IP to update`,
Required: true,
Deprecated: false,
Positional: false,
},
{
Name: "reverse",
Short: `New reverse IP to update, not updated if null`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*baremetal.UpdateIPRequest)

client := core.ExtractClient(ctx)
api := baremetal.NewAPI(client)
return api.UpdateIP(request)

},
}
}

func baremetalOptionsAdd() *core.Command {
return &core.Command{
Short: `Add server option`,
Expand Down