Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
Files
11
+ 10
4
@@ -3,6 +3,7 @@ package main
import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"context"
"fmt"
"github.com/google/uuid"
@@ -10,12 +11,14 @@ import (
)
func main() {
log.SetLevel(log.DebugLevel)
sbi := &nucleus.OpenConfig{}
device := nucleus.Device{
SBI: sbi,
Device: &openconfig.Device{},
SBI: sbi,
Config: nucleus.DeviceConfig{
Uuid: uuid.New(),
Address: "141.100.70.170:6030",
Address: "[fdfd::ce05]:6030",
Username: "admin",
Password: "arista",
},
@@ -33,11 +36,14 @@ func main() {
ctx := gnmi.NewContext(context.Background(), cfg)
ctx = context.WithValue(ctx, "config", cfg)
paths := []string{"interfaces/interface"}
paths := []string{"/interfaces/interface[name=*]/name"}
req, err := gnmi.NewGetRequest(gnmi.SplitPaths(paths), "")
resp, err := nucleus.GetWithRequest(ctx, req)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%v", resp)
if err := device.Add(resp); err != nil {
panic(err)
}
fmt.Println(device.Config)
}
Loading