Skip to content
Snippets Groups Projects

Enable export and import of SDN configuration

Merged Ghost User requested to merge export-import-sdn-config into develop
3 files
+ 22
15
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -11,6 +11,7 @@ import (
@@ -11,6 +11,7 @@ import (
"code.fbi.h-da.de/danet/gosdn/controller/store"
"code.fbi.h-da.de/danet/gosdn/controller/store"
"github.com/google/uuid"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
"github.com/openconfig/ygot/ygot"
 
"github.com/openconfig/ygot/ytypes"
tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
log "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
@@ -238,7 +239,8 @@ func (s *NetworkElementService) createNetworkElementFromStore(loadedNetworkEleme
@@ -238,7 +239,8 @@ func (s *NetworkElementService) createNetworkElementFromStore(loadedNetworkEleme
}
}
// Use unmarshall from the network elements SBI to unmarshall ygot json in go struct.
// Use unmarshall from the network elements SBI to unmarshall ygot json in go struct.
err = mne.SBI().Unmarshal([]byte(loadedNetworkElement.Model), path, mne.GetModel())
opts := []ytypes.UnmarshalOpt{&ytypes.IgnoreReadOnlyFields{}, &ytypes.IgnoreExtraFields{}}
 
err = mne.SBI().Unmarshal([]byte(loadedNetworkElement.Model), path, mne.GetModel(), opts...)
if err != nil {
if err != nil {
return nil, err
return nil, err
}
}
Loading