Skip to content

Commit 2b3b4fe

Browse files
authored
feat(interlink): add support for peer_asn (#941)
1 parent 56248df commit 2b3b4fe

File tree

6 files changed

+44
-0
lines changed

6 files changed

+44
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ async def create_link(
764764
tags: Optional[List[str]] = None,
765765
connection_id: Optional[str] = None,
766766
partner_id: Optional[str] = None,
767+
peer_asn: Optional[int] = None,
767768
) -> Link:
768769
"""
769770
Create a link.
@@ -778,6 +779,7 @@ async def create_link(
778779
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
779780
: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.
780781
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
782+
: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.
781783
:return: :class:`Link <Link>`
782784
783785
Usage:
@@ -805,6 +807,7 @@ async def create_link(
805807
region=region,
806808
project_id=project_id,
807809
tags=tags,
810+
peer_asn=peer_asn,
808811
connection_id=connection_id,
809812
partner_id=partner_id,
810813
),
@@ -822,6 +825,7 @@ async def update_link(
822825
region: Optional[ScwRegion] = None,
823826
name: Optional[str] = None,
824827
tags: Optional[List[str]] = None,
828+
peer_asn: Optional[int] = None,
825829
) -> Link:
826830
"""
827831
Update a link.
@@ -830,6 +834,7 @@ async def update_link(
830834
:param region: Region to target. If none is passed will use default region from the config.
831835
:param name: Name of the link.
832836
:param tags: List of tags to apply to the link.
837+
:param peer_asn: For self-hosted links, AS Number to establish BGP session.
833838
:return: :class:`Link <Link>`
834839
835840
Usage:
@@ -854,6 +859,7 @@ async def update_link(
854859
region=region,
855860
name=name,
856861
tags=tags,
862+
peer_asn=peer_asn,
857863
),
858864
self.client,
859865
),

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

+6
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ def marshal_CreateLinkRequest(
576576
if request.tags is not None:
577577
output["tags"] = request.tags
578578

579+
if request.peer_asn is not None:
580+
output["peer_asn"] = request.peer_asn
581+
579582
return output
580583

581584

@@ -615,6 +618,9 @@ def marshal_UpdateLinkRequest(
615618
if request.tags is not None:
616619
output["tags"] = request.tags
617620

621+
if request.peer_asn is not None:
622+
output["peer_asn"] = request.peer_asn
623+
618624
return output
619625

620626

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

+10
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ class CreateLinkRequest:
533533
List of tags to apply to the link.
534534
"""
535535

536+
peer_asn: Optional[int]
537+
"""
538+
For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
539+
"""
540+
536541
connection_id: Optional[str]
537542

538543
partner_id: Optional[str]
@@ -1070,6 +1075,11 @@ class UpdateLinkRequest:
10701075
List of tags to apply to the link.
10711076
"""
10721077

1078+
peer_asn: Optional[int]
1079+
"""
1080+
For self-hosted links, AS Number to establish BGP session.
1081+
"""
1082+
10731083

10741084
@dataclass
10751085
class UpdateRoutingPolicyRequest:

scaleway/scaleway/interlink/v1beta1/api.py

+6
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ def create_link(
762762
tags: Optional[List[str]] = None,
763763
connection_id: Optional[str] = None,
764764
partner_id: Optional[str] = None,
765+
peer_asn: Optional[int] = None,
765766
) -> Link:
766767
"""
767768
Create a link.
@@ -776,6 +777,7 @@ def create_link(
776777
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
777778
: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.
778779
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
780+
: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.
779781
:return: :class:`Link <Link>`
780782
781783
Usage:
@@ -803,6 +805,7 @@ def create_link(
803805
region=region,
804806
project_id=project_id,
805807
tags=tags,
808+
peer_asn=peer_asn,
806809
connection_id=connection_id,
807810
partner_id=partner_id,
808811
),
@@ -820,6 +823,7 @@ def update_link(
820823
region: Optional[ScwRegion] = None,
821824
name: Optional[str] = None,
822825
tags: Optional[List[str]] = None,
826+
peer_asn: Optional[int] = None,
823827
) -> Link:
824828
"""
825829
Update a link.
@@ -828,6 +832,7 @@ def update_link(
828832
:param region: Region to target. If none is passed will use default region from the config.
829833
:param name: Name of the link.
830834
:param tags: List of tags to apply to the link.
835+
:param peer_asn: For self-hosted links, AS Number to establish BGP session.
831836
:return: :class:`Link <Link>`
832837
833838
Usage:
@@ -852,6 +857,7 @@ def update_link(
852857
region=region,
853858
name=name,
854859
tags=tags,
860+
peer_asn=peer_asn,
855861
),
856862
self.client,
857863
),

scaleway/scaleway/interlink/v1beta1/marshalling.py

+6
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ def marshal_CreateLinkRequest(
576576
if request.tags is not None:
577577
output["tags"] = request.tags
578578

579+
if request.peer_asn is not None:
580+
output["peer_asn"] = request.peer_asn
581+
579582
return output
580583

581584

@@ -615,6 +618,9 @@ def marshal_UpdateLinkRequest(
615618
if request.tags is not None:
616619
output["tags"] = request.tags
617620

621+
if request.peer_asn is not None:
622+
output["peer_asn"] = request.peer_asn
623+
618624
return output
619625

620626

scaleway/scaleway/interlink/v1beta1/types.py

+10
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ class CreateLinkRequest:
533533
List of tags to apply to the link.
534534
"""
535535

536+
peer_asn: Optional[int]
537+
"""
538+
For self-hosted links we need the peer AS Number to establish BGP session. If not given, a default one will be assigned.
539+
"""
540+
536541
connection_id: Optional[str]
537542

538543
partner_id: Optional[str]
@@ -1070,6 +1075,11 @@ class UpdateLinkRequest:
10701075
List of tags to apply to the link.
10711076
"""
10721077

1078+
peer_asn: Optional[int]
1079+
"""
1080+
For self-hosted links, AS Number to establish BGP session.
1081+
"""
1082+
10731083

10741084
@dataclass
10751085
class UpdateRoutingPolicyRequest:

0 commit comments

Comments
 (0)