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
65630a13
Commit
65630a13
authored
1 year ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
add getAllMne and getAllPnd
parent
5922b50e
No related branches found
No related tags found
1 merge request
!790
Resolve "Update gRPC abstraction API with missing calls and refactoring"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controller/api/managedNetworkElement.go
+32
-0
32 additions, 0 deletions
controller/api/managedNetworkElement.go
controller/api/pnd.go
+15
-0
15 additions, 0 deletions
controller/api/pnd.go
with
47 additions
and
0 deletions
controller/api/managedNetworkElement.go
+
32
−
0
View file @
65630a13
...
...
@@ -50,6 +50,23 @@ func AddNetworkElement(ctx context.Context, addr, mneName, mneUUID string, opt *
return
client
.
AddList
(
ctx
,
req
)
}
// AddNetworkElementList adds all the network elements to the controller. The name of each network element is optional.
// If no name is provided a name will be generated upon network element creation.
func
AddNetworkElementList
(
ctx
context
.
Context
,
addr
,
pid
string
,
mneList
[]
*
mnepb
.
SetMne
)
(
*
mnepb
.
AddListResponse
,
error
)
{
client
,
err
:=
nbi
.
NetworkElementClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
}
req
:=
&
mnepb
.
AddListRequest
{
Timestamp
:
time
.
Now
()
.
UnixNano
(),
Mne
:
mneList
,
Pid
:
pid
,
}
return
client
.
AddList
(
ctx
,
req
)
}
// GetNetworkElement requests one network element belonging to a given
// PrincipalNetworkDomain from the controller. If no network element identifier
// is provided, an error is thrown.
...
...
@@ -72,6 +89,21 @@ func GetNetworkElement(ctx context.Context, addr, pid string, mneid string) (*mn
return
client
.
Get
(
ctx
,
req
)
}
// GetNetworkElements requests all available network elements related to one PND.
func
GetNetworkElements
(
ctx
context
.
Context
,
addr
,
pid
string
)
(
*
mnepb
.
GetAllResponse
,
error
)
{
client
,
err
:=
nbi
.
NetworkElementClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
}
req
:=
&
mnepb
.
GetAllRequest
{
Timestamp
:
time
.
Now
()
.
UnixNano
(),
Pid
:
pid
,
}
return
client
.
GetAll
(
ctx
,
req
)
}
// GetPluginSchemaTree gets the schema tree for a plugin.
func
GetPluginSchemaTree
(
ctx
context
.
Context
,
addr
string
,
pluginID
uuid
.
UUID
)
(
map
[
string
]
*
yang
.
Entry
,
error
)
{
pluginClient
,
err
:=
nbi
.
PluginClient
(
addr
,
dialOptions
...
)
...
...
This diff is collapsed.
Click to expand it.
controller/api/pnd.go
+
15
−
0
View file @
65630a13
...
...
@@ -30,6 +30,21 @@ func CreatePnd(ctx context.Context, addr, name, description string) (*ppb.Create
return
pndClient
.
CreatePndList
(
ctx
,
req
)
}
// CreatePndList uses the provided creation properties to add all the PNDs to the controller.
func
CreatePndList
(
ctx
context
.
Context
,
addr
string
,
pnds
[]
*
ppb
.
PndCreateProperties
)
(
*
ppb
.
CreatePndListResponse
,
error
)
{
pndClient
,
err
:=
nbi
.
PndClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
}
req
:=
&
ppb
.
CreatePndListRequest
{
Timestamp
:
time
.
Now
()
.
UnixNano
(),
Pnd
:
pnds
,
}
return
pndClient
.
CreatePndList
(
ctx
,
req
)
}
// GetPnd requests one PrincipalNetworkDomain from the
// controller.
func
GetPnd
(
ctx
context
.
Context
,
addr
string
,
args
string
)
(
*
ppb
.
GetPndResponse
,
error
)
{
...
...
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