Skip to content

Commit 7d2c62a

Browse files
authored
feat(interlink): add support for routing policy (#5000)
1 parent f48450b commit 7d2c62a

File tree

6 files changed

+40
-19
lines changed

6 files changed

+40
-19
lines changed

cmd/scw/testdata/test-all-usage-interlink-link-create-usage.golden

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ USAGE:
66
scw interlink link create [arg=value ...]
77

88
ARGS:
9-
[project-id] Project ID to use. If none is passed the default project ID will be used
10-
name Name of the link
11-
[tags.{index}] List of tags to apply to the link
12-
pop-id PoP (location) where the link will be created
13-
bandwidth-mbps Desired bandwidth for the link. Must be compatible with available link bandwidths and remaining bandwidth capacity of the connection
14-
[connection-id] If set, creates a self-hosted link using this dedicated physical connection. As the customer, specify the ID of the physical connection you already have for this link.
15-
[partner-id] If set, creates a hosted link on a partner's connection. Specify the ID of the chosen partner, who already has a shared connection with available bandwidth.
16-
[peer-asn] For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
17-
[vlan] For self-hosted links only, it is possible to choose the VLAN ID. If the VLAN is not available (ie already taken or out of range), an error is returned.
18-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
[project-id] Project ID to use. If none is passed the default project ID will be used
10+
name Name of the link
11+
[tags.{index}] List of tags to apply to the link
12+
pop-id PoP (location) where the link will be created
13+
bandwidth-mbps Desired bandwidth for the link. Must be compatible with available link bandwidths and remaining bandwidth capacity of the connection
14+
[connection-id] If set, creates a self-hosted link using this dedicated physical connection. As the customer, specify the ID of the physical connection you already have for this link.
15+
[partner-id] If set, creates a hosted link on a partner's connection. Specify the ID of the chosen partner, who already has a shared connection with available bandwidth.
16+
[peer-asn] For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
17+
[vlan] For self-hosted links only, it is possible to choose the VLAN ID. If the VLAN is not available (ie already taken or out of range), an error is returned.
18+
[routing-policy-v4-id] If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.
19+
[routing-policy-v6-id] If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.
20+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1921

2022
FLAGS:
2123
-h, --help help for create

cmd/scw/testdata/test-all-usage-interlink-link-list-usage.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ ARGS:
1010
[project-id] Project ID to filter for
1111
[name] Link name to filter for
1212
[tags.{index}] Tags to filter for
13-
[status] Link status to filter for (unknown_link_status | configuring | failed | requested | refused | expired | provisioning | active | limited_connectivity | all_down | deprovisioning | deleted | locked)
14-
[bgp-v4-status] BGP IPv4 status to filter for (unknown_bgp_status | up | down)
15-
[bgp-v6-status] BGP IPv6 status to filter for (unknown_bgp_status | up | down)
13+
[status] Link status to filter for (unknown_link_status | configuring | failed | requested | refused | expired | provisioning | active | limited_connectivity | all_down | deprovisioning | deleted | locked | ready)
14+
[bgp-v4-status] BGP IPv4 status to filter for (unknown_bgp_status | up | down | disabled)
15+
[bgp-v6-status] BGP IPv6 status to filter for (unknown_bgp_status | up | down | disabled)
1616
[pop-id] Filter for links attached to this PoP (via connections)
1717
[bandwidth-mbps] Filter for link bandwidth (in Mbps)
1818
[partner-id] Filter for links hosted by this partner

docs/commands/interlink.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ scw interlink link create [arg=value ...]
114114
| partner-id | | If set, creates a hosted link on a partner's connection. Specify the ID of the chosen partner, who already has a shared connection with available bandwidth. |
115115
| peer-asn | | For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned. |
116116
| vlan | | For self-hosted links only, it is possible to choose the VLAN ID. If the VLAN is not available (ie already taken or out of range), an error is returned. |
117+
| routing-policy-v4-id | | If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created. |
118+
| routing-policy-v6-id | | If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created. |
117119
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
118120

119121

@@ -258,9 +260,9 @@ scw interlink link list [arg=value ...]
258260
| project-id | | Project ID to filter for |
259261
| name | | Link name to filter for |
260262
| tags.{index} | | Tags to filter for |
261-
| status | One of: `unknown_link_status`, `configuring`, `failed`, `requested`, `refused`, `expired`, `provisioning`, `active`, `limited_connectivity`, `all_down`, `deprovisioning`, `deleted`, `locked` | Link status to filter for |
262-
| bgp-v4-status | One of: `unknown_bgp_status`, `up`, `down` | BGP IPv4 status to filter for |
263-
| bgp-v6-status | One of: `unknown_bgp_status`, `up`, `down` | BGP IPv6 status to filter for |
263+
| status | One of: `unknown_link_status`, `configuring`, `failed`, `requested`, `refused`, `expired`, `provisioning`, `active`, `limited_connectivity`, `all_down`, `deprovisioning`, `deleted`, `locked`, `ready` | Link status to filter for |
264+
| bgp-v4-status | One of: `unknown_bgp_status`, `up`, `down`, `disabled` | BGP IPv4 status to filter for |
265+
| bgp-v6-status | One of: `unknown_bgp_status`, `up`, `down`, `disabled` | BGP IPv6 status to filter for |
264266
| pop-id | | Filter for links attached to this PoP (via connections) |
265267
| bandwidth-mbps | | Filter for link bandwidth (in Mbps) |
266268
| partner-id | | Filter for links hosted by this partner |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.24.0
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250911091431-3c6786e253d0
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250912134829-9294f115f3d2
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.10.1
2929
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
460460
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
461461
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
462462
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
463-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250911091431-3c6786e253d0 h1:EOCbW0MnUjNKndDwoWiGwXix7no3Fe74sVDiXp8wMag=
464-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250911091431-3c6786e253d0/go.mod h1:47B1d/YXmSAxlJxUJxClzHR6b3T4M1WyCvwENPQNBWc=
463+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250912134829-9294f115f3d2 h1:WeANDlfGb3oFt08xg4TVd+zmVfif6/9uVXXMjg7Jgr4=
464+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250912134829-9294f115f3d2/go.mod h1:47B1d/YXmSAxlJxUJxClzHR6b3T4M1WyCvwENPQNBWc=
465465
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
466466
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
467467
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/interlink/v1beta1/interlink_cli.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ func interlinkLinkList() *core.Command {
373373
"deprovisioning",
374374
"deleted",
375375
"locked",
376+
"ready",
376377
},
377378
},
378379
{
@@ -385,6 +386,7 @@ func interlinkLinkList() *core.Command {
385386
"unknown_bgp_status",
386387
"up",
387388
"down",
389+
"disabled",
388390
},
389391
},
390392
{
@@ -397,6 +399,7 @@ func interlinkLinkList() *core.Command {
397399
"unknown_bgp_status",
398400
"up",
399401
"down",
402+
"disabled",
400403
},
401404
},
402405
{
@@ -594,6 +597,20 @@ func interlinkLinkCreate() *core.Command {
594597
Deprecated: false,
595598
Positional: false,
596599
},
600+
{
601+
Name: "routing-policy-v4-id",
602+
Short: `If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.`,
603+
Required: false,
604+
Deprecated: false,
605+
Positional: false,
606+
},
607+
{
608+
Name: "routing-policy-v6-id",
609+
Short: `If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.`,
610+
Required: false,
611+
Deprecated: false,
612+
Positional: false,
613+
},
597614
core.RegionArgSpec(
598615
scw.RegionFrPar,
599616
scw.RegionNlAms,

0 commit comments

Comments
 (0)