Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
danet
goSDN
Commits
e17e6adc
Commit
e17e6adc
authored
1 year ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
add mne update to API, needs some considerations after disccussion
parent
65630a13
No related branches found
No related tags found
1 merge request
!790
Resolve "Update gRPC abstraction API with missing calls and refactoring"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/api/managedNetworkElement.go
+27
-0
27 additions, 0 deletions
controller/api/managedNetworkElement.go
with
27 additions
and
0 deletions
controller/api/managedNetworkElement.go
+
27
−
0
View file @
e17e6adc
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"io"
"io"
"time"
"time"
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/conflict"
mnepb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
mnepb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
pipb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/plugin-internal"
pipb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/plugin-internal"
spb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
spb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound"
...
@@ -250,3 +251,29 @@ func DeleteNetworkElement(ctx context.Context, addr, pid, mneid string) (*mnepb.
...
@@ -250,3 +251,29 @@ func DeleteNetworkElement(ctx context.Context, addr, pid, mneid string) (*mnepb.
return
client
.
Delete
(
ctx
,
req
)
return
client
.
Delete
(
ctx
,
req
)
}
}
// UpdateNetworkElement changes the metadata of the network element which is stored in the controller storage.
// Correct resource version needs to be provided to allow a change of the object in the storage.
func
UpdateNetworkElement
(
ctx
context
.
Context
,
addr
,
mneid
,
updatedName
,
updatedTransportAddress
,
updatedPid
string
,
resourceVersion
*
conflict
.
Metadata
)
(
*
mnepb
.
UpdateNetworkElementResponse
,
error
)
{
client
,
err
:=
nbi
.
NetworkElementClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
}
// Note: Consider changing what to update. Some values are quite iffy to change.
req
:=
&
mnepb
.
UpdateNetworkElementRequest
{
Timestamp
:
time
.
Now
()
.
UnixNano
(),
NetworkElement
:
&
mnepb
.
ManagedNetworkElement
{
Id
:
mneid
,
Name
:
updatedName
,
TransportAddress
:
updatedTransportAddress
,
TransportOption
:
&
tpb
.
TransportOption
{
Address
:
updatedTransportAddress
,
},
Metadata
:
resourceVersion
,
AssociatedPnd
:
updatedPid
,
},
}
return
client
.
Update
(
ctx
,
req
)
}
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