Skip to content
Snippets Groups Projects

Allow iBGP update on both provisioning and active trunks

Merged Karel van Klink requested to merge feature/update-ibgp-on-provisioning-trunk into develop
All threads resolved!
Files
3
@@ -104,14 +104,17 @@ def get_active_iptrunk_subscriptions(includes: list[str] | None = None) -> list[
return get_subscriptions(product_type="Iptrunk", lifecycle=SubscriptionLifecycle.ACTIVE, includes=includes)
def get_active_trunks_that_terminate_on_router(subscription_id: UUIDstr) -> list[SubscriptionTable]:
"""Get all IP trunk subscriptions that are active, and terminate on the given ``subscription_id`` of a Router.
def get_trunks_that_terminate_on_router(
subscription_id: UUIDstr, lifecycle_state: SubscriptionLifecycle
) -> list[SubscriptionTable]:
"""Get all IP trunk subscriptions that terminate on the given ``subscription_id`` of a Router.
Given a ``subscription_id`` of a Router subscription, this method gives a list of all active IP trunk subscriptions
that terminate on this Router.
Given a ``subscription_id`` of a Router subscription, this method gives a list of all IP trunk subscriptions that
terminate on this Router. The given lifecycle state dictates the state of trunk subscriptions that are counted as
terminating on this router.
:param subscription_id: Subscription ID of a Router
:type subscription_id: UUIDstr
:param UUIDstr subscription_id: Subscription ID of a Router
:param SubscriptionLifecycle lifecycle_state: Required lifecycle state of the IP trunk
:return: A list of IP trunk subscriptions
:rtype: list[SubscriptionTable]
@@ -121,7 +124,7 @@ def get_active_trunks_that_terminate_on_router(subscription_id: UUIDstr) -> list
.join(ProductTable)
.filter(
ProductTable.product_type == "Iptrunk",
SubscriptionTable.status == "active",
SubscriptionTable.status == lifecycle_state,
)
.all()
)
Loading