Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
daed2912
Commit
daed2912
authored
1 year ago
by
Neda Moeini
Committed by
Mohammad Torkashvand
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Apply 3 suggestion(s) to 1 file(s)
parent
b02eb086
No related branches found
No related tags found
1 merge request
!187
add topology rest api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/api/v1/network.py
+3
-10
3 additions, 10 deletions
gso/api/v1/network.py
with
3 additions
and
10 deletions
gso/api/v1/network.py
+
3
−
10
View file @
daed2912
...
...
@@ -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
ip
trunk subscriptions.
"""
"""
Retrieve all active or provisioning
IP
trunk subscriptions.
"""
topology
:
dict
=
{
"
iptrunks
"
:
[]}
active_iptrunks
=
get_active_iptrunk_subscriptions
()
for
iptrunk
in
active_iptrunks
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment