Skip to content

Commit 90df98d

Browse files
authored
feat(instance): modify UpdateServer public_ips and private_nics to match real implem (#3413)
1 parent 0cfe8a9 commit 90df98d

File tree

3 files changed

+27
-138
lines changed

3 files changed

+27
-138
lines changed

cmd/scw/testdata/test-all-usage-instance-server-update-usage.golden

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,27 @@ EXAMPLES:
2525
scw instance server server update 11111111-1111-1111-1111-111111111111 placement-group-id=11111111-1111-1111-1111-111111111111
2626

2727
ARGS:
28-
server-id UUID of the Instance
29-
[name] Name of the Instance
30-
[ip] IP that should be attached to the server (use ip=none to detach)
31-
[cloud-init] The cloud-init script to use (Support file loading with @/path/to/file)
32-
[boot-type] (local | bootscript | rescue)
33-
[tags.{index}] Tags of the Instance
34-
[volumes.{key}.boot=false] Force the Instance to boot on this volume
35-
[volumes.{key}.base-snapshot] ID of the snapshot on which this volume will be based
36-
[volumes.{key}.project] Project ID of the volume
37-
[volumes.{key}.organization] Organization ID of the volume
38-
[dynamic-ip-required]
39-
[routed-ip-enabled] True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False)
40-
[public-ips.{index}.id] Unique ID of the IP address
41-
[public-ips.{index}.address] Instance's public IP-Address
42-
[public-ips.{index}.gateway] Gateway's IP address
43-
[public-ips.{index}.netmask] CIDR netmask
44-
[public-ips.{index}.family] IP address family (inet or inet6) (inet | inet6)
45-
[public-ips.{index}.dynamic] True if the IP address is dynamic
46-
[public-ips.{index}.provisioning-mode] Information about this address provisioning mode (manual | dhcp | slaac)
47-
[public-ips.{index}.tags.{index}] Tags associated with the IP
48-
[enable-ipv6]
49-
[protected]
50-
[security-group-id]
51-
[volume-ids.{index}] Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes)
52-
[placement-group-id] Placement group ID if Instance must be part of a placement group
53-
[private-nics.{index}.id] Private NIC unique ID
54-
[private-nics.{index}.server-id] Instance to which the private NIC is attached
55-
[private-nics.{index}.private-network-id] Private Network the private NIC is attached to
56-
[private-nics.{index}.mac-address] Private NIC MAC address
57-
[private-nics.{index}.state] Private NIC state (available | syncing | syncing_error)
58-
[private-nics.{index}.tags.{index}] Private NIC tags
59-
[commercial-type] Set the commercial_type for this Instance.
60-
[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)
28+
server-id UUID of the Instance
29+
[name] Name of the Instance
30+
[ip] IP that should be attached to the server (use ip=none to detach)
31+
[cloud-init] The cloud-init script to use (Support file loading with @/path/to/file)
32+
[boot-type] (local | bootscript | rescue)
33+
[tags.{index}] Tags of the Instance
34+
[volumes.{key}.boot=false] Force the Instance to boot on this volume
35+
[volumes.{key}.base-snapshot] ID of the snapshot on which this volume will be based
36+
[volumes.{key}.project] Project ID of the volume
37+
[volumes.{key}.organization] Organization ID of the volume
38+
[dynamic-ip-required]
39+
[routed-ip-enabled] True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False)
40+
[public-ips.{index}] A list of reserved IP IDs to attach to the Instance
41+
[enable-ipv6]
42+
[protected]
43+
[security-group-id]
44+
[volume-ids.{index}] Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes)
45+
[placement-group-id] Placement group ID if Instance must be part of a placement group
46+
[private-nics.{index}] Instance private NICs
47+
[commercial-type] Set the commercial_type for this Instance.
48+
[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)
6149

6250
DEPRECATED ARGS:
6351
[bootscript]

docs/commands/instance.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,25 +2263,13 @@ scw instance server update <server-id ...> [arg=value ...]
22632263
| ~~bootscript~~ | Deprecated | |
22642264
| dynamic-ip-required | | |
22652265
| routed-ip-enabled | | True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False) |
2266-
| public-ips.{index}.id | | Unique ID of the IP address |
2267-
| public-ips.{index}.address | | Instance's public IP-Address |
2268-
| public-ips.{index}.gateway | | Gateway's IP address |
2269-
| public-ips.{index}.netmask | | CIDR netmask |
2270-
| public-ips.{index}.family | One of: `inet`, `inet6` | IP address family (inet or inet6) |
2271-
| public-ips.{index}.dynamic | | True if the IP address is dynamic |
2272-
| public-ips.{index}.provisioning-mode | One of: `manual`, `dhcp`, `slaac` | Information about this address provisioning mode |
2273-
| public-ips.{index}.tags.{index} | | Tags associated with the IP |
2266+
| public-ips.{index} | | A list of reserved IP IDs to attach to the Instance |
22742267
| enable-ipv6 | | |
22752268
| protected | | |
22762269
| security-group-id | | |
22772270
| volume-ids.{index} | | Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes) |
22782271
| placement-group-id | | Placement group ID if Instance must be part of a placement group |
2279-
| private-nics.{index}.id | | Private NIC unique ID |
2280-
| private-nics.{index}.server-id | | Instance to which the private NIC is attached |
2281-
| private-nics.{index}.private-network-id | | Private Network the private NIC is attached to |
2282-
| private-nics.{index}.mac-address | | Private NIC MAC address |
2283-
| private-nics.{index}.state | One of: `available`, `syncing`, `syncing_error` | Private NIC state |
2284-
| private-nics.{index}.tags.{index} | | Private NIC tags |
2272+
| private-nics.{index} | | Instance private NICs |
22852273
| commercial-type | | Set the commercial_type for this Instance. |
22862274
| 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 |
22872275

internal/namespaces/instance/v1/instance_cli.go

Lines changed: 4 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -676,59 +676,8 @@ func instanceServerUpdate() *core.Command {
676676
Positional: false,
677677
},
678678
{
679-
Name: "public-ips.{index}.id",
680-
Short: `Unique ID of the IP address`,
681-
Required: false,
682-
Deprecated: false,
683-
Positional: false,
684-
},
685-
{
686-
Name: "public-ips.{index}.address",
687-
Short: `Instance's public IP-Address`,
688-
Required: false,
689-
Deprecated: false,
690-
Positional: false,
691-
},
692-
{
693-
Name: "public-ips.{index}.gateway",
694-
Short: `Gateway's IP address`,
695-
Required: false,
696-
Deprecated: false,
697-
Positional: false,
698-
},
699-
{
700-
Name: "public-ips.{index}.netmask",
701-
Short: `CIDR netmask`,
702-
Required: false,
703-
Deprecated: false,
704-
Positional: false,
705-
},
706-
{
707-
Name: "public-ips.{index}.family",
708-
Short: `IP address family (inet or inet6)`,
709-
Required: false,
710-
Deprecated: false,
711-
Positional: false,
712-
EnumValues: []string{"inet", "inet6"},
713-
},
714-
{
715-
Name: "public-ips.{index}.dynamic",
716-
Short: `True if the IP address is dynamic`,
717-
Required: false,
718-
Deprecated: false,
719-
Positional: false,
720-
},
721-
{
722-
Name: "public-ips.{index}.provisioning-mode",
723-
Short: `Information about this address provisioning mode`,
724-
Required: false,
725-
Deprecated: false,
726-
Positional: false,
727-
EnumValues: []string{"manual", "dhcp", "slaac"},
728-
},
729-
{
730-
Name: "public-ips.{index}.tags.{index}",
731-
Short: `Tags associated with the IP`,
679+
Name: "public-ips.{index}",
680+
Short: `A list of reserved IP IDs to attach to the Instance`,
732681
Required: false,
733682
Deprecated: false,
734683
Positional: false,
@@ -765,44 +714,8 @@ func instanceServerUpdate() *core.Command {
765714
Positional: false,
766715
},
767716
{
768-
Name: "private-nics.{index}.id",
769-
Short: `Private NIC unique ID`,
770-
Required: false,
771-
Deprecated: false,
772-
Positional: false,
773-
},
774-
{
775-
Name: "private-nics.{index}.server-id",
776-
Short: `Instance to which the private NIC is attached`,
777-
Required: false,
778-
Deprecated: false,
779-
Positional: false,
780-
},
781-
{
782-
Name: "private-nics.{index}.private-network-id",
783-
Short: `Private Network the private NIC is attached to`,
784-
Required: false,
785-
Deprecated: false,
786-
Positional: false,
787-
},
788-
{
789-
Name: "private-nics.{index}.mac-address",
790-
Short: `Private NIC MAC address`,
791-
Required: false,
792-
Deprecated: false,
793-
Positional: false,
794-
},
795-
{
796-
Name: "private-nics.{index}.state",
797-
Short: `Private NIC state`,
798-
Required: false,
799-
Deprecated: false,
800-
Positional: false,
801-
EnumValues: []string{"available", "syncing", "syncing_error"},
802-
},
803-
{
804-
Name: "private-nics.{index}.tags.{index}",
805-
Short: `Private NIC tags`,
717+
Name: "private-nics.{index}",
718+
Short: `Instance private NICs`,
806719
Required: false,
807720
Deprecated: false,
808721
Positional: false,

0 commit comments

Comments
 (0)