Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TFS
controller
Commits
1d4f227b
Commit
1d4f227b
authored
1 month ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Common - Object Factory tools:
- Added field name to json_link()
parent
a377af3d
No related branches found
No related tags found
2 merge requests
!328
Resolve "(CTTC) Update recommendations to use SocketIO on NBI and E2E Orch components"
,
!286
Resolve "(CTTC) Implement integration test between E2E-IP-Optical SDN Controllers"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/tools/object_factory/Link.py
+7
-1
7 additions, 1 deletion
src/common/tools/object_factory/Link.py
with
7 additions
and
1 deletion
src/common/tools/object_factory/Link.py
+
7
−
1
View file @
1d4f227b
...
...
@@ -15,6 +15,8 @@
import
copy
from
typing
import
Dict
,
List
,
Optional
,
Tuple
from
common.proto.context_pb2
import
LinkTypeEnum
def
get_link_uuid
(
a_endpoint_id
:
Dict
,
z_endpoint_id
:
Dict
)
->
str
:
return
'
{:s}/{:s}=={:s}/{:s}
'
.
format
(
a_endpoint_id
[
'
device_id
'
][
'
device_uuid
'
][
'
uuid
'
],
a_endpoint_id
[
'
endpoint_uuid
'
][
'
uuid
'
],
...
...
@@ -25,9 +27,13 @@ def json_link_id(link_uuid : str) -> Dict:
def
json_link
(
link_uuid
:
str
,
endpoint_ids
:
List
[
Dict
],
name
:
Optional
[
str
]
=
None
,
link_type
:
LinkTypeEnum
=
LinkTypeEnum
.
LINKTYPE_UNKNOWN
,
total_capacity_gbps
:
Optional
[
float
]
=
None
,
used_capacity_gbps
:
Optional
[
float
]
=
None
)
->
Dict
:
result
=
{
'
link_id
'
:
json_link_id
(
link_uuid
),
'
link_endpoint_ids
'
:
copy
.
deepcopy
(
endpoint_ids
)}
result
=
{
'
link_id
'
:
json_link_id
(
link_uuid
),
'
link_type
'
:
link_type
,
'
link_endpoint_ids
'
:
copy
.
deepcopy
(
endpoint_ids
),
}
if
name
is
not
None
:
result
[
'
name
'
]
=
name
if
total_capacity_gbps
is
not
None
:
attributes
:
Dict
=
result
.
setdefault
(
'
attributes
'
,
dict
())
...
...
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