Skip to content

Commit 910d845

Browse files
committed
Support of _patch SERVER security_group and _patch SERVER bootscript
1 parent 18f0000 commit 910d845

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'
10201020

10211021
#### Features
10221022

1023+
* Support of `_patch SERVER security_group` and `_patch SERVER bootscript`
10231024
* Improved resolver behavior when matching multiple results, now displaying more info too help choosing candidates ([#47](https://github.com/scaleway/scaleway-cli/issues/47))
10241025
* `scw exec SERVER [COMMAND] [ARGS...]`, *COMMAND* is now optional
10251026
* Showing the server MOTD when calling `scw run <image> [COMMAND]` without *COMMAND*

commands/x_patch.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,22 @@ func runPatch(cmd *types.Command, args []string) {
7575
changes++
7676
payload.Name = &newValue
7777
}
78+
case "bootscript":
79+
log.Debugf("%s=%s => %s=%s", fieldName, currentServer.Bootscript.Identifier, fieldName, newValue)
80+
if currentServer.Bootscript.Identifier != newValue {
81+
changes++
82+
payload.Bootscript.Identifier = newValue
83+
}
84+
case "security_group":
85+
log.Debugf("%s=%s => %s=%s", fieldName, currentServer.SecurityGroup.Identifier, fieldName, newValue)
86+
if currentServer.SecurityGroup.Identifier != newValue {
87+
changes++
88+
payload.SecurityGroup.Identifier = newValue
89+
}
7890
default:
7991
log.Fatalf("'_patch server %s=' not implemented", fieldName)
8092
}
93+
// FIXME: volumes, tags, dynamic_ip_required
8194

8295
if changes > 0 {
8396
log.Debugf("updating server: %d change(s)", changes)

0 commit comments

Comments
 (0)