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
c16d84f3
Commit
c16d84f3
authored
4 months ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
NBI component - TFS API:
- Corrected POST/DELETE methods
parent
faeea472
No related branches found
No related tags found
1 merge request
!315
Resolve "(CTTC) Define fields to specify type of link"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py
+10
-6
10 additions, 6 deletions
src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py
with
10 additions
and
6 deletions
src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py
+
10
−
6
View file @
c16d84f3
...
@@ -301,16 +301,20 @@ class Link(_Resource):
...
@@ -301,16 +301,20 @@ class Link(_Resource):
def
put
(
self
,
link_uuid
:
str
):
def
put
(
self
,
link_uuid
:
str
):
link_json
=
request
.
get_json
()
link_json
=
request
.
get_json
()
link
=
grpc_link
(
link_json
)
link
=
grpc_link
(
link_json
)
virtual_types
=
{
LinkTypeEnum
.
LINKTYPE_VIRTUAL_COPPER
,
LinkTypeEnum
.
LINKTYPE_VIRTUAL_OPTICAL
}
if
link_uuid
!=
link
.
link_id
.
link_uuid
.
uuid
:
if
link_uuid
!=
link
.
link_id
.
link_uuid
.
uuid
:
raise
BadRequest
(
'
Mismatching link_uuid
'
)
raise
BadRequest
(
'
Mismatching link_uuid
'
)
el
if
link
.
link_type
in
virtual_types
:
if
link
.
link_type
==
LinkTypeEnum
.
LINKTYPE_VIRTUAL
:
link
=
grpc_l
ink
(
link
_json
)
return
format_grpc_to_json
(
self
.
vntmanager_client
.
SetVirtualL
ink
(
link
)
)
return
format_grpc_to_json
(
self
.
vntmanager_client
.
SetVirtualLink
(
link
))
else
:
return
format_grpc_to_json
(
self
.
context_client
.
SetLink
(
grpc_link
(
link
)
))
return
format_grpc_to_json
(
self
.
context_client
.
SetLink
(
link
))
def
delete
(
self
,
link_uuid
:
str
):
def
delete
(
self
,
link_uuid
:
str
):
return
format_grpc_to_json
(
self
.
context_client
.
RemoveLink
(
grpc_link_id
(
link_uuid
)))
link_id
=
grpc_link_id
(
link_uuid
)
link
=
self
.
context_client
.
GetLink
(
link_id
)
if
link
.
link_type
==
LinkTypeEnum
.
LINKTYPE_VIRTUAL
:
return
format_grpc_to_json
(
self
.
vntmanager_client
.
RemoveVirtualLink
(
link_id
))
else
:
return
format_grpc_to_json
(
self
.
context_client
.
RemoveLink
(
link_id
))
class
ConnectionIds
(
_Resource
):
class
ConnectionIds
(
_Resource
):
def
get
(
self
,
context_uuid
:
str
,
service_uuid
:
str
):
def
get
(
self
,
context_uuid
:
str
,
service_uuid
:
str
):
...
...
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