Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
7 files
+ 41
228
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 8
3
@@ -6,9 +6,14 @@ import (
schema "code.fbi.h-da.de/cocsn/yang-models/generated/arista"
"context"
"github.com/google/uuid"
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
)
/*
Simple gnmi request program. Use with cauton and leaf paths only.
*/
func main() {
log.SetLevel(log.DebugLevel)
sbi := &nucleus.AristaOC{}
@@ -33,15 +38,15 @@ func main() {
Addr: device.Config.Address,
Password: device.Config.Password,
Username: device.Config.Username,
Encoding: gpb.Encoding_PROTO,
}
ctx := gnmi.NewContext(context.Background(), cfg)
ctx = context.WithValue(ctx, "config", cfg)
p := []string{"/interfaces/interface"}
p := []string{"/interfaces/interface[name=en0]/state/name"}
errors := 0
for _, path := range p {
req, err := gnmi.NewGetRequest(gnmi.SplitPaths([]string{path}), "")
resp, err := nucleus.GetWithRequest(ctx, req)
resp, err := device.Transport.Get(ctx, path)
if err != nil {
log.Debug(err)
errors++
Loading