File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1313 from ..load_balancer_types import BoundLoadBalancerType
1414 from ..locations import BoundLocation
1515 from ..metrics import Metrics
16- from ..networks import BoundNetwork
16+ from ..networks import BoundNetwork , Network
1717 from ..servers import BoundServer
1818 from .client import BoundLoadBalancer
1919
@@ -107,6 +107,16 @@ def __init__(
107107 self .ingoing_traffic = ingoing_traffic
108108 self .included_traffic = included_traffic
109109
110+ def private_net_for (self , network : BoundNetwork | Network ) -> PrivateNet | None :
111+ """
112+ Returns the load balancer's network attachment information in the given Network,
113+ and None if no attachment was found.
114+ """
115+ for o in self .private_net :
116+ if o .network .id == network .id :
117+ return o
118+ return None
119+
110120
111121class LoadBalancerService (BaseDomain ):
112122 """LoadBalancerService Domain
Original file line number Diff line number Diff line change 1414 from ..images import BoundImage
1515 from ..isos import BoundIso
1616 from ..metrics import Metrics
17- from ..networks import BoundNetwork
17+ from ..networks import BoundNetwork , Network
1818 from ..placement_groups import BoundPlacementGroup
1919 from ..primary_ips import BoundPrimaryIP , PrimaryIP
2020 from ..server_types import BoundServerType
@@ -154,6 +154,16 @@ def __init__(
154154 self .primary_disk_size = primary_disk_size
155155 self .placement_group = placement_group
156156
157+ def private_net_for (self , network : BoundNetwork | Network ) -> PrivateNet | None :
158+ """
159+ Returns the server's network attachment information in the given Network,
160+ and None if no attachment was found.
161+ """
162+ for o in self .private_net :
163+ if o .network .id == network .id :
164+ return o
165+ return None
166+
157167
158168class CreateServerResponse (BaseDomain ):
159169 """Create Server Response Domain
You can’t perform that action at this time.
0 commit comments