Skip to content
Snippets Groups Projects
Commit daed2912 authored by Neda Moeini's avatar Neda Moeini Committed by Mohammad Torkashvand
Browse files

Apply 3 suggestion(s) to 1 file(s)

parent b02eb086
No related branches found
No related tags found
1 merge request!187add topology rest api
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment