Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
2 files
+ 3
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 3
1
@@ -20,6 +20,7 @@ import (
@@ -20,6 +20,7 @@ import (
pb "code.fbi.h-da.de/cocsn/gosdn/api/proto"
pb "code.fbi.h-da.de/cocsn/gosdn/api/proto"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
 
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health"
@@ -211,11 +212,13 @@ func (s *server) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.Ad
@@ -211,11 +212,13 @@ func (s *server) AddDevice(ctx context.Context, in *pb.AddDeviceRequest) (*pb.Ad
}
}
sbi := s.core.principalNetworkDomains[uuidPND].GetSBIs()["default"]
sbi := s.core.principalNetworkDomains[uuidPND].GetSBIs()["default"]
 
//TODO: could the transport and the related config be created in device?
transport := &Gnmi{SetNode: sbi.SetNode()}
transport := &Gnmi{SetNode: sbi.SetNode()}
cfg := &gnmi.Config{
cfg := &gnmi.Config{
Addr: in.Device.Address,
Addr: in.Device.Address,
Username: in.Device.Username,
Username: in.Device.Username,
Password: in.Device.Password,
Password: in.Device.Password,
 
Encoding: gpb.Encoding_JSON_IETF,
}
}
transport.SetConfig(cfg)
transport.SetConfig(cfg)
@@ -261,7 +264,6 @@ func (s *server) HandleDeviceGetRequest(ctx context.Context, in *pb.DeviceGetReq
@@ -261,7 +264,6 @@ func (s *server) HandleDeviceGetRequest(ctx context.Context, in *pb.DeviceGetReq
if err != nil {
if err != nil {
return &pb.DeviceGetReply{Message: err.Error()}, err
return &pb.DeviceGetReply{Message: err.Error()}, err
}
}
log.Info(device)
d, err := json.MarshalIndent(device, "", "\t")
d, err := json.MarshalIndent(device, "", "\t")
if err != nil {
if err != nil {
Loading