Skip to content

Commit b6e0975

Browse files
authored
feat(interlink): choose vlan for self-hosted links (scaleway#1041)
1 parent 3435128 commit b6e0975

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

scaleway-async/scaleway_async/interlink/v1beta1/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ async def create_link(
767767
connection_id: Optional[str] = None,
768768
partner_id: Optional[str] = None,
769769
peer_asn: Optional[int] = None,
770+
vlan: Optional[int] = None,
770771
) -> Link:
771772
"""
772773
Create a link.
@@ -782,6 +783,7 @@ async def create_link(
782783
:param 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.
783784
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
784785
:param 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.
786+
:param 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.
785787
:return: :class:`Link <Link>`
786788
787789
Usage:
@@ -810,6 +812,7 @@ async def create_link(
810812
project_id=project_id,
811813
tags=tags,
812814
peer_asn=peer_asn,
815+
vlan=vlan,
813816
connection_id=connection_id,
814817
partner_id=partner_id,
815818
),

scaleway-async/scaleway_async/interlink/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ def marshal_CreateLinkRequest(
596596
if request.peer_asn is not None:
597597
output["peer_asn"] = request.peer_asn
598598

599+
if request.vlan is not None:
600+
output["vlan"] = request.vlan
601+
599602
return output
600603

601604

scaleway-async/scaleway_async/interlink/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ class CreateLinkRequest:
553553
For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
554554
"""
555555

556+
vlan: Optional[int]
557+
"""
558+
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.
559+
"""
560+
556561
connection_id: Optional[str]
557562

558563
partner_id: Optional[str]

scaleway/scaleway/interlink/v1beta1/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ def create_link(
765765
connection_id: Optional[str] = None,
766766
partner_id: Optional[str] = None,
767767
peer_asn: Optional[int] = None,
768+
vlan: Optional[int] = None,
768769
) -> Link:
769770
"""
770771
Create a link.
@@ -780,6 +781,7 @@ def create_link(
780781
:param 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.
781782
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
782783
:param 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.
784+
:param 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.
783785
:return: :class:`Link <Link>`
784786
785787
Usage:
@@ -808,6 +810,7 @@ def create_link(
808810
project_id=project_id,
809811
tags=tags,
810812
peer_asn=peer_asn,
813+
vlan=vlan,
811814
connection_id=connection_id,
812815
partner_id=partner_id,
813816
),

scaleway/scaleway/interlink/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ def marshal_CreateLinkRequest(
596596
if request.peer_asn is not None:
597597
output["peer_asn"] = request.peer_asn
598598

599+
if request.vlan is not None:
600+
output["vlan"] = request.vlan
601+
599602
return output
600603

601604

scaleway/scaleway/interlink/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ class CreateLinkRequest:
553553
For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
554554
"""
555555

556+
vlan: Optional[int]
557+
"""
558+
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.
559+
"""
560+
556561
connection_id: Optional[str]
557562

558563
partner_id: Optional[str]

0 commit comments

Comments
 (0)