Skip to content
Snippets Groups Projects

add topology rest api

Merged Mohammad Torkashvand requested to merge feature/NAT-499-goatgraph into develop
All threads resolved!
1 file
+ 3
10
Compare changes
  • Side-by-side
  • Inline
+ 3
10
@@ -11,10 +11,7 @@ from starlette import status
from gso.products.product_blocks.iptrunk import PhysicalPortCapacity
from gso.services.subscriptions import get_active_iptrunk_subscriptions
router = APIRouter(
prefix="/networks",
tags=["Network"],
)
router = APIRouter(prefix="/networks", tags=["Network"],)
class RouterBlock(OrchestratorBaseModel):
@@ -62,13 +59,9 @@ def _calculate_iptrunk_capacity(iptrunk_sides: list, iptrunk_speed: PhysicalPort
return f"{capacity}G"
@router.get(
"/topology",
status_code=status.HTTP_200_OK,
response_model=NetworkTopologyDomainModelSchema,
)
@router.get("/topology", status_code=status.HTTP_200_OK, response_model=NetworkTopologyDomainModelSchema,)
def network_topology() -> NetworkTopologyDomainModelSchema:
"""Retrieve all active or provisioning iptrunk subscriptions."""
"""Retrieve all active or provisioning IP trunk subscriptions."""
topology: dict = {"iptrunks": []}
active_iptrunks = get_active_iptrunk_subscriptions()
for iptrunk in active_iptrunks:
Loading