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
04c55e4f
Commit
04c55e4f
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
4ffc66f4
No related branches found
No related tags found
2 merge requests
!221
Thesis mk
,
!173
Process response overhaul
Pipeline
#74375
passed with warnings
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cli/grpc.go
+5
-3
5 additions, 3 deletions
cli/grpc.go
cmd/addDevice.go
+5
-0
5 additions, 0 deletions
cmd/addDevice.go
with
10 additions
and
3 deletions
cli/grpc.go
+
5
−
3
View file @
04c55e4f
...
...
@@ -9,6 +9,7 @@ import (
spb
"code.fbi.h-da.de/cocsn/api/go/gosdn/southbound"
tpb
"code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
nbi
"code.fbi.h-da.de/cocsn/gosdn/northbound/client"
"github.com/google/uuid"
log
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
...
...
@@ -41,7 +42,7 @@ func Init(addr string) error {
log
.
Infof
(
"SBI: %v"
,
sbi
)
}
}
return
nil
return
viper
.
WriteConfig
()
}
// GetIds requests all UUID information from the controller
...
...
@@ -184,7 +185,7 @@ func AddDevice(addr, username, password, sbi, pnd, deviceAddress, deviceName str
},
DeviceName
:
deviceName
,
TransportOption
:
&
tpb
.
TransportOption
{
Address
:
addr
,
Address
:
deviceAddress
,
Username
:
username
,
Password
:
password
,
TransportOption
:
&
tpb
.
TransportOption_GnmiTransportOption
{
...
...
@@ -196,7 +197,8 @@ func AddDevice(addr, username, password, sbi, pnd, deviceAddress, deviceName str
Pid
:
pnd
,
}
if
sbi
==
"csbi"
{
req
.
Ond
[
0
]
.
Sbi
=
nil
req
.
Ond
[
0
]
.
Sbi
.
Id
=
uuid
.
Nil
.
String
()
req
.
Ond
[
0
]
.
Sbi
.
Type
=
spb
.
Type_CONTAINERISED
req
.
Ond
[
0
]
.
TransportOption
.
Csbi
=
true
}
ctx
:=
context
.
Background
()
...
...
This diff is collapsed.
Click to expand it.
cmd/addDevice.go
+
5
−
0
View file @
04c55e4f
...
...
@@ -47,6 +47,9 @@ var addDeviceCmd = &cobra.Command{
Device address and user credentials need to be provided
if they diverge from the default credentials.`
,
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
if
csbi
{
cliSbi
=
"csbi"
}
resp
,
err
:=
cli
.
AddDevice
(
apiEndpoint
,
username
,
...
...
@@ -65,9 +68,11 @@ if they diverge from the default credentials.`,
}
var
deviceName
string
var
csbi
bool
func
init
()
{
cliCmd
.
AddCommand
(
addDeviceCmd
)
addDeviceCmd
.
Flags
()
.
StringVar
(
&
deviceName
,
"name"
,
""
,
"add a device name (optional)"
)
addDeviceCmd
.
Flags
()
.
BoolVar
(
&
csbi
,
"csbi"
,
false
,
"add a csbi device"
)
}
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