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
5922b50e
Commit
5922b50e
authored
1 year ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
rename pnd requests in API to fit definition
parent
1746a763
No related branches found
No related tags found
1 merge request
!790
Resolve "Update gRPC abstraction API with missing calls and refactoring"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cli/cmd/pndCreate.go
+1
-1
1 addition, 1 deletion
cli/cmd/pndCreate.go
cli/cmd/pndList.go
+1
-1
1 addition, 1 deletion
cli/cmd/pndList.go
controller/api/api_test.go
+1
-1
1 addition, 1 deletion
controller/api/api_test.go
controller/api/pnd.go
+4
-4
4 additions, 4 deletions
controller/api/pnd.go
with
7 additions
and
7 deletions
cli/cmd/pndCreate.go
+
1
−
1
View file @
5922b50e
...
...
@@ -50,7 +50,7 @@ A description must be passed as positional argument.`,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
spinner
,
_
:=
pterm
.
DefaultSpinner
.
Start
(
"Creating new PND"
)
_
,
err
:=
api
.
Add
Pnd
(
createContextWithAuthorization
(),
viper
.
GetString
(
"controllerApiEndpoint"
),
pndName
,
pndDescription
)
_
,
err
:=
api
.
Create
Pnd
(
createContextWithAuthorization
(),
viper
.
GetString
(
"controllerApiEndpoint"
),
pndName
,
pndDescription
)
if
err
!=
nil
{
spinner
.
Fail
(
"Failed creating the PND with name: "
,
pndName
)
spinner
.
Fail
(
err
)
...
...
This diff is collapsed.
Click to expand it.
cli/cmd/pndList.go
+
1
−
1
View file @
5922b50e
...
...
@@ -47,7 +47,7 @@ var pndListCmd = &cobra.Command{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
spinner
,
_
:=
pterm
.
DefaultSpinner
.
Start
(
"Fetching PND list from controller"
)
resp
,
err
:=
api
.
GetPnd
s
(
createContextWithAuthorization
(),
pndAdapter
.
Endpoint
())
resp
,
err
:=
api
.
GetPnd
List
(
createContextWithAuthorization
(),
pndAdapter
.
Endpoint
())
if
err
!=
nil
{
spinner
.
Fail
(
err
)
return
...
...
This diff is collapsed.
Click to expand it.
controller/api/api_test.go
+
1
−
1
View file @
5922b50e
...
...
@@ -55,7 +55,7 @@ func ensureStoreFileForTestsIsRemoved(storeName string) {
func
Test_AddPnd
(
t
*
testing
.
T
)
{
defer
ensureFilesForTestsAreRemoved
()
resp
,
err
:=
Add
Pnd
(
context
.
TODO
(),
bufnet
,
"test"
,
"test pnd"
)
resp
,
err
:=
Create
Pnd
(
context
.
TODO
(),
bufnet
,
"test"
,
"test pnd"
)
if
err
!=
nil
{
t
.
Error
(
err
)
return
...
...
This diff is collapsed.
Click to expand it.
controller/api/pnd.go
+
4
−
4
View file @
5922b50e
...
...
@@ -9,9 +9,9 @@ import (
nbi
"code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
)
//
Add
Pnd takes a name
,
description
and SBI UUID
to create a new
//
Create
Pnd takes
an address,
a name
and a
description to create a new
// PrincipalNetworkDomain on the controller.
func
Add
Pnd
(
ctx
context
.
Context
,
addr
,
name
,
description
string
)
(
*
ppb
.
CreatePndListResponse
,
error
)
{
func
Create
Pnd
(
ctx
context
.
Context
,
addr
,
name
,
description
string
)
(
*
ppb
.
CreatePndListResponse
,
error
)
{
pndClient
,
err
:=
nbi
.
PndClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -48,9 +48,9 @@ func GetPnd(ctx context.Context, addr string, args string) (*ppb.GetPndResponse,
return
pndClient
.
GetPnd
(
ctx
,
req
)
}
// GetPnd
s
requests all PrincipalNetworkDomains from the
// GetPnd
List
requests all PrincipalNetworkDomains from the
// controller.
func
GetPnd
s
(
ctx
context
.
Context
,
addr
string
,
args
...
string
)
(
*
ppb
.
GetPndListResponse
,
error
)
{
func
GetPnd
List
(
ctx
context
.
Context
,
addr
string
,
args
...
string
)
(
*
ppb
.
GetPndListResponse
,
error
)
{
pndClient
,
err
:=
nbi
.
PndClient
(
addr
,
dialOptions
...
)
if
err
!=
nil
{
return
nil
,
err
...
...
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