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
cd80faa1
Commit
cd80faa1
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Service component:
- Corrected format of URLs in OpticalTools.py
parent
570d9918
No related branches found
No related tags found
2 merge requests
!235
Release TeraFlowSDN 3.0
,
!223
Resolve "Fix OFC'24 end-to-end test for Optical Controller component"
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/service/tools/OpticalTools.py
+4
-4
4 additions, 4 deletions
src/service/service/tools/OpticalTools.py
with
4 additions
and
4 deletions
src/service/service/tools/OpticalTools.py
+
4
−
4
View file @
cd80faa1
...
...
@@ -109,11 +109,11 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str:
if
ob_band
is
None
:
if
bidir
is
None
:
bidir
=
1
urlx
=
"
{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
src
,
dst
,
bitrate
,
bidir
)
urlx
=
"
{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
src
,
dst
,
str
(
bitrate
)
,
str
(
bidir
)
)
else
:
if
bidir
is
None
:
bidir
=
1
urlx
=
"
{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
src
,
dst
,
bitrate
,
bidir
,
ob_band
)
urlx
=
"
{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
src
,
dst
,
str
(
bitrate
)
,
str
(
bidir
)
,
str
(
ob_band
)
)
r
=
requests
.
put
(
urlx
,
headers
=
headers
)
reply
=
r
.
text
return
reply
...
...
@@ -127,7 +127,7 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str:
def
get_optical_band
(
idx
)
->
str
:
if
not
TESTING
:
base_url
=
get_optical_controller_base_url
()
urlx
=
"
{:s}/GetOpticalBand/{:s}
"
.
format
(
base_url
,
idx
)
urlx
=
"
{:s}/GetOpticalBand/{:s}
"
.
format
(
base_url
,
str
(
idx
)
)
headers
=
{
"
Content-Type
"
:
"
application/json
"
}
r
=
requests
.
get
(
urlx
,
headers
=
headers
)
reply
=
r
.
text
...
...
@@ -143,7 +143,7 @@ def delete_lightpath(flow_id, src, dst, bitrate) -> str:
reply
=
"
200
"
if
not
TESTING
:
base_url
=
get_optical_controller_base_url
()
urlx
=
"
{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
flow_id
,
src
,
dst
,
bitrate
)
urlx
=
"
{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}
"
.
format
(
base_url
,
str
(
flow_id
)
,
src
,
dst
,
str
(
bitrate
)
)
headers
=
{
"
Content-Type
"
:
"
application/json
"
}
r
=
requests
.
delete
(
urlx
,
headers
=
headers
)
...
...
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