Skip to content

feat(instance): update API to use the new 'IP Mobility' network stack #3205

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

Merged
merged 1 commit into from
Jun 15, 2023
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 @@ -19,6 +19,7 @@ ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] Tags of the IP
[server] UUID of the Instance you want to attach the IP to
[type] IP type to reserve (either 'nat', 'routed_ipv4' or 'routed_ipv6') (unknown_iptype | nat | routed_ipv4 | routed_ipv6)
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[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 | pl-waw-1 | pl-waw-2)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EXAMPLES:
ARGS:
ip IP ID or IP address
[reverse] Reverse domain name
[type] Convert a 'nat' IP to a 'routed_ipv4' (unknown_iptype | nat | routed_ipv4 | routed_ipv6)
[tags.{index}] An array of keywords you want to tag this IP with
[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 | pl-waw-1 | pl-waw-2)

Expand Down
2 changes: 1 addition & 1 deletion cmd/scw/testdata/test-all-usage-instance-ip-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A flexible IP address is an IP address which you hold independently of any Instance.
You can attach it to any of your Instances and do live migration of the IP address between your Instances.

Note that attaching a flexible IP address to an Instance will remove the previous public IP address of the Instance and cut any ongoing public connection to the Instance.
Note that attaching a flexible IP address to an Instance removes its previous public IP and interrupts any ongoing public connection to the Instance. This does not apply if you have migrated your server to the new Network stack and have at least one flexible IP attached to the Instance.

USAGE:
scw instance ip <command>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ ARGS:
[volumes.{key}.project] Project ID of the volume
[volumes.{key}.organization] Organization ID of the volume
[dynamic-ip-required]
[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)
[public-ips.{index}.id] Unique ID of the IP address
[public-ips.{index}.address] Instance's public IP-Address
[public-ips.{index}.gateway] Gateway's IP address
[public-ips.{index}.netmask] CIDR netmask
[public-ips.{index}.family] IP address family (inet or inet6) (inet | inet6)
[public-ips.{index}.dynamic] True if the IP address is dynamic
[public-ips.{index}.provisioning-mode] Information about this address provisioning mode (manual | dhcp | slaac)
[enable-ipv6]
[protected]
[security-group-id]
Expand Down
12 changes: 11 additions & 1 deletion docs/commands/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ scw instance image wait 11111111-1111-1111-1111-111111111111
A flexible IP address is an IP address which you hold independently of any Instance.
You can attach it to any of your Instances and do live migration of the IP address between your Instances.

Note that attaching a flexible IP address to an Instance will remove the previous public IP address of the Instance and cut any ongoing public connection to the Instance.
Note that attaching a flexible IP address to an Instance removes its previous public IP and interrupts any ongoing public connection to the Instance. This does not apply if you have migrated your server to the new Network stack and have at least one flexible IP attached to the Instance.



Expand Down Expand Up @@ -394,6 +394,7 @@ scw instance ip create [arg=value ...]
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| tags.{index} | | Tags of the IP |
| server | | UUID of the Instance you want to attach the IP to |
| type | One of: `unknown_iptype`, `nat`, `routed_ipv4`, `routed_ipv6` | IP type to reserve (either 'nat', 'routed_ipv4' or 'routed_ipv6') |
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |

Expand Down Expand Up @@ -589,6 +590,7 @@ scw instance ip update <ip ...> [arg=value ...]
|------|---|-------------|
| ip | Required | IP ID or IP address |
| reverse | | Reverse domain name |
| type | One of: `unknown_iptype`, `nat`, `routed_ipv4`, `routed_ipv6` | Convert a 'nat' IP to a 'routed_ipv4' |
| tags.{index} | | An array of keywords you want to tag this IP with |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |

Expand Down Expand Up @@ -2188,6 +2190,14 @@ scw instance server update <server-id ...> [arg=value ...]
| volumes.{key}.organization | | Organization ID of the volume |
| ~~bootscript~~ | Deprecated | |
| dynamic-ip-required | | |
| 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) |
| public-ips.{index}.id | | Unique ID of the IP address |
| public-ips.{index}.address | | Instance's public IP-Address |
| public-ips.{index}.gateway | | Gateway's IP address |
| public-ips.{index}.netmask | | CIDR netmask |
| public-ips.{index}.family | One of: `inet`, `inet6` | IP address family (inet or inet6) |
| public-ips.{index}.dynamic | | True if the IP address is dynamic |
| public-ips.{index}.provisioning-mode | One of: `manual`, `dhcp`, `slaac` | Information about this address provisioning mode |
| enable-ipv6 | | |
| protected | | |
| security-group-id | | |
Expand Down
76 changes: 75 additions & 1 deletion internal/namespaces/instance/v1/instance_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func instanceIP() *core.Command {
Long: `A flexible IP address is an IP address which you hold independently of any Instance.
You can attach it to any of your Instances and do live migration of the IP address between your Instances.

Note that attaching a flexible IP address to an Instance will remove the previous public IP address of the Instance and cut any ongoing public connection to the Instance.
Note that attaching a flexible IP address to an Instance removes its previous public IP and interrupts any ongoing public connection to the Instance. This does not apply if you have migrated your server to the new Network stack and have at least one flexible IP attached to the Instance.
`,
Namespace: "instance",
Resource: "ip",
Expand Down Expand Up @@ -647,6 +647,64 @@ func instanceServerUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "routed-ip-enabled",
Short: `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)`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.id",
Short: `Unique ID of the IP address`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.address",
Short: `Instance's public IP-Address`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.gateway",
Short: `Gateway's IP address`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.netmask",
Short: `CIDR netmask`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.family",
Short: `IP address family (inet or inet6)`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"inet", "inet6"},
},
{
Name: "public-ips.{index}.dynamic",
Short: `True if the IP address is dynamic`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "public-ips.{index}.provisioning-mode",
Short: `Information about this address provisioning mode`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"manual", "dhcp", "slaac"},
},
{
Name: "enable-ipv6",
Required: false,
Expand Down Expand Up @@ -3123,6 +3181,14 @@ func instanceIPCreate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "type",
Short: `IP type to reserve (either 'nat', 'routed_ipv4' or 'routed_ipv6')`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_iptype", "nat", "routed_ipv4", "routed_ipv6"},
},
core.OrganizationArgSpec(),
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Expand Down Expand Up @@ -3219,6 +3285,14 @@ func instanceIPUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "type",
Short: `Convert a 'nat' IP to a 'routed_ipv4'`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_iptype", "nat", "routed_ipv4", "routed_ipv6"},
},
{
Name: "tags.{index}",
Short: `An array of keywords you want to tag this IP with`,
Expand Down