Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
2 files
+ 18
25
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 8
2
@@ -3,6 +3,7 @@ package main
@@ -3,6 +3,7 @@ package main
import (
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
 
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"context"
"context"
"fmt"
"fmt"
"github.com/google/uuid"
"github.com/google/uuid"
@@ -12,6 +13,7 @@ import (
@@ -12,6 +13,7 @@ import (
func main() {
func main() {
sbi := &nucleus.OpenConfig{}
sbi := &nucleus.OpenConfig{}
device := nucleus.Device{
device := nucleus.Device{
 
Device: &openconfig.Device{},
SBI: sbi,
SBI: sbi,
Config: nucleus.DeviceConfig{
Config: nucleus.DeviceConfig{
Uuid: uuid.New(),
Uuid: uuid.New(),
@@ -33,11 +35,15 @@ func main() {
@@ -33,11 +35,15 @@ func main() {
ctx := gnmi.NewContext(context.Background(), cfg)
ctx := gnmi.NewContext(context.Background(), cfg)
ctx = context.WithValue(ctx, "config", cfg)
ctx = context.WithValue(ctx, "config", cfg)
paths := []string{"interfaces/interface"}
paths := []string{""}
req, err := gnmi.NewGetRequest(gnmi.SplitPaths(paths), "")
req, err := gnmi.NewGetRequest(gnmi.SplitPaths(paths), "")
resp, err := nucleus.GetWithRequest(ctx, req)
resp, err := nucleus.GetWithRequest(ctx, req)
if err != nil {
if err != nil {
log.Fatal(err)
log.Fatal(err)
}
}
fmt.Printf("%v", resp)
fmt.Println(resp)
 
if err := device.Add(resp); err != nil {
 
log.Fatal(err)
 
}
 
fmt.Println(device.Config)
}
}
Loading