Skip to content

Commit 51f8e6e

Browse files
feat(interlink): add support for RoutingPolicyV4ID, RoutingPolicyV6ID and IsIPv6 (scaleway#4787)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 34fc155 commit 51f8e6e

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ USAGE:
66
scw interlink link detach_policy <link-id ...> [arg=value ...]
77

88
ARGS:
9-
link-id ID of the link to detach a routing policy from
10-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
link-id ID of the link to detach a routing policy from
10+
routing-policy-id ID of the routing policy to be detached
11+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1112

1213
FLAGS:
1314
-h, --help help for detach_policy

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ARGS:
1111
[tags.{index}] List of tags to apply to the routing policy
1212
[prefix-filter-in.{index}] IP prefixes to accept from the peer (ranges of route announcements to accept)
1313
[prefix-filter-out.{index}] IP prefix filters to advertise to the peer (ranges of routes to advertise)
14+
[is-ipv6] IP prefixes version of the routing policy
1415
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1516

1617
FLAGS:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARGS:
1010
[project-id] Project ID to filter for
1111
[name] Routing policy name to filter for
1212
[tags.{index}] Tags to filter for
13+
[ipv6] Filter for the routing policies based on IP prefixes version
1314
[organization-id] Organization ID to filter for
1415
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1516

docs/commands/interlink.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ scw interlink link detach_policy <link-id ...> [arg=value ...]
153153
| Name | | Description |
154154
|------|---|-------------|
155155
| link-id | Required | ID of the link to detach a routing policy from |
156+
| routing-policy-id | Required | ID of the routing policy to be detached |
156157
| 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 |
157158

158159

@@ -416,6 +417,7 @@ scw interlink routing-policy create [arg=value ...]
416417
| tags.{index} | | List of tags to apply to the routing policy |
417418
| prefix-filter-in.{index} | | IP prefixes to accept from the peer (ranges of route announcements to accept) |
418419
| prefix-filter-out.{index} | | IP prefix filters to advertise to the peer (ranges of routes to advertise) |
420+
| is-ipv6 | | IP prefixes version of the routing policy |
419421
| 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 |
420422

421423

@@ -479,6 +481,7 @@ scw interlink routing-policy list [arg=value ...]
479481
| project-id | | Project ID to filter for |
480482
| name | | Routing policy name to filter for |
481483
| tags.{index} | | Tags to filter for |
484+
| ipv6 | | Filter for the routing policies based on IP prefixes version |
482485
| organization-id | | Organization ID to filter for |
483486
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
484487

internal/namespaces/interlink/v1beta1/interlink_cli.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"reflect"
99

1010
"github.com/scaleway/scaleway-cli/v2/core"
11-
interlink "github.com/scaleway/scaleway-sdk-go/api/interlink/v1beta1"
11+
"github.com/scaleway/scaleway-sdk-go/api/interlink/v1beta1"
1212
"github.com/scaleway/scaleway-sdk-go/scw"
1313
)
1414

@@ -826,6 +826,13 @@ func interlinkLinkDetachPolicy() *core.Command {
826826
Deprecated: false,
827827
Positional: true,
828828
},
829+
{
830+
Name: "routing-policy-id",
831+
Short: `ID of the routing policy to be detached`,
832+
Required: true,
833+
Deprecated: false,
834+
Positional: false,
835+
},
829836
core.RegionArgSpec(
830837
scw.RegionFrPar,
831838
scw.RegionNlAms,
@@ -955,6 +962,13 @@ func interlinkRoutingPolicyList() *core.Command {
955962
Deprecated: false,
956963
Positional: false,
957964
},
965+
{
966+
Name: "ipv6",
967+
Short: `Filter for the routing policies based on IP prefixes version`,
968+
Required: false,
969+
Deprecated: false,
970+
Positional: false,
971+
},
958972
{
959973
Name: "organization-id",
960974
Short: `Organization ID to filter for`,
@@ -1062,6 +1076,13 @@ func interlinkRoutingPolicyCreate() *core.Command {
10621076
Deprecated: false,
10631077
Positional: false,
10641078
},
1079+
{
1080+
Name: "is-ipv6",
1081+
Short: `IP prefixes version of the routing policy`,
1082+
Required: false,
1083+
Deprecated: false,
1084+
Positional: false,
1085+
},
10651086
core.RegionArgSpec(
10661087
scw.RegionFrPar,
10671088
scw.RegionNlAms,

0 commit comments

Comments
 (0)