You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scaleway-async/scaleway_async/interlink/v1beta1/api.py
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@
38
38
Partner,
39
39
Pop,
40
40
RoutingPolicy,
41
+
SetRoutingPolicyRequest,
41
42
UpdateLinkRequest,
42
43
UpdateRoutingPolicyRequest,
43
44
)
@@ -61,6 +62,7 @@
61
62
marshal_CreateLinkRequest,
62
63
marshal_CreateRoutingPolicyRequest,
63
64
marshal_DetachRoutingPolicyRequest,
65
+
marshal_SetRoutingPolicyRequest,
64
66
marshal_UpdateLinkRequest,
65
67
marshal_UpdateRoutingPolicyRequest,
66
68
)
@@ -768,6 +770,8 @@ async def create_link(
768
770
partner_id: Optional[str] =None,
769
771
peer_asn: Optional[int] =None,
770
772
vlan: Optional[int] =None,
773
+
routing_policy_v4_id: Optional[str] =None,
774
+
routing_policy_v6_id: Optional[str] =None,
771
775
) ->Link:
772
776
"""
773
777
Create a link.
@@ -784,6 +788,8 @@ async def create_link(
784
788
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
785
789
: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
790
: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.
791
+
:param routing_policy_v4_id: If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.
792
+
:param routing_policy_v6_id: If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.
Replace a routing policy from an existing link. This is usefull when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do.
1098
+
:param link_id: ID of the link to set a routing policy from.
1099
+
:param routing_policy_id: ID of the routing policy to be set.
1100
+
:param region: Region to target. If none is passed will use default region from the config.
Copy file name to clipboardExpand all lines: scaleway-async/scaleway_async/interlink/v1beta1/types.py
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ class BgpStatus(str, Enum, metaclass=StrEnumMeta):
19
19
UNKNOWN_BGP_STATUS="unknown_bgp_status"
20
20
UP="up"
21
21
DOWN="down"
22
+
DISABLED="disabled"
22
23
23
24
def__str__(self) ->str:
24
25
returnstr(self.value)
@@ -60,6 +61,7 @@ class LinkStatus(str, Enum, metaclass=StrEnumMeta):
60
61
DEPROVISIONING="deprovisioning"
61
62
DELETED="deleted"
62
63
LOCKED="locked"
64
+
READY="ready"
63
65
64
66
def__str__(self) ->str:
65
67
returnstr(self.value)
@@ -558,6 +560,16 @@ class CreateLinkRequest:
558
560
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
561
"""
560
562
563
+
routing_policy_v4_id: Optional[str] =None
564
+
"""
565
+
If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.
566
+
"""
567
+
568
+
routing_policy_v6_id: Optional[str] =None
569
+
"""
570
+
If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.
571
+
"""
572
+
561
573
connection_id: Optional[str] =None
562
574
563
575
partner_id: Optional[str] =None
@@ -1093,6 +1105,24 @@ class ListRoutingPoliciesResponse:
1093
1105
total_count: int
1094
1106
1095
1107
1108
+
@dataclass
1109
+
classSetRoutingPolicyRequest:
1110
+
link_id: str
1111
+
"""
1112
+
ID of the link to set a routing policy from.
1113
+
"""
1114
+
1115
+
routing_policy_id: str
1116
+
"""
1117
+
ID of the routing policy to be set.
1118
+
"""
1119
+
1120
+
region: Optional[ScwRegion] =None
1121
+
"""
1122
+
Region to target. If none is passed will use default region from the config.
Copy file name to clipboardExpand all lines: scaleway/scaleway/interlink/v1beta1/api.py
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@
38
38
Partner,
39
39
Pop,
40
40
RoutingPolicy,
41
+
SetRoutingPolicyRequest,
41
42
UpdateLinkRequest,
42
43
UpdateRoutingPolicyRequest,
43
44
)
@@ -61,6 +62,7 @@
61
62
marshal_CreateLinkRequest,
62
63
marshal_CreateRoutingPolicyRequest,
63
64
marshal_DetachRoutingPolicyRequest,
65
+
marshal_SetRoutingPolicyRequest,
64
66
marshal_UpdateLinkRequest,
65
67
marshal_UpdateRoutingPolicyRequest,
66
68
)
@@ -766,6 +768,8 @@ def create_link(
766
768
partner_id: Optional[str] =None,
767
769
peer_asn: Optional[int] =None,
768
770
vlan: Optional[int] =None,
771
+
routing_policy_v4_id: Optional[str] =None,
772
+
routing_policy_v6_id: Optional[str] =None,
769
773
) ->Link:
770
774
"""
771
775
Create a link.
@@ -782,6 +786,8 @@ def create_link(
782
786
One-Of ('host'): at most one of 'connection_id', 'partner_id' could be set.
783
787
: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
788
: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.
789
+
:param routing_policy_v4_id: If set, attaches this routing policy containing IPv4 prefixes to the Link. Hence, a BGP IPv4 session will be created.
790
+
:param routing_policy_v6_id: If set, attaches this routing policy containing IPv6 prefixes to the Link. Hence, a BGP IPv6 session will be created.
785
791
:return: :class:`Link <Link>`
786
792
787
793
Usage:
@@ -811,6 +817,8 @@ def create_link(
811
817
tags=tags,
812
818
peer_asn=peer_asn,
813
819
vlan=vlan,
820
+
routing_policy_v4_id=routing_policy_v4_id,
821
+
routing_policy_v6_id=routing_policy_v6_id,
814
822
connection_id=connection_id,
815
823
partner_id=partner_id,
816
824
),
@@ -1075,6 +1083,51 @@ def detach_routing_policy(
1075
1083
self._throw_on_error(res)
1076
1084
returnunmarshal_Link(res.json())
1077
1085
1086
+
defset_routing_policy(
1087
+
self,
1088
+
*,
1089
+
link_id: str,
1090
+
routing_policy_id: str,
1091
+
region: Optional[ScwRegion] =None,
1092
+
) ->Link:
1093
+
"""
1094
+
Set a routing policy.
1095
+
Replace a routing policy from an existing link. This is usefull when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do.
1096
+
:param link_id: ID of the link to set a routing policy from.
1097
+
:param routing_policy_id: ID of the routing policy to be set.
1098
+
:param region: Region to target. If none is passed will use default region from the config.
0 commit comments