Skip to content
Snippets Groups Projects

Resolve "Update gRPC abstraction API with missing calls and refactoring"

Merged Fabian Seidl requested to merge 359-update-grpc-abstraction-api-with-missing-calls into master
2 files
+ 47
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -50,6 +50,23 @@ func AddNetworkElement(ctx context.Context, addr, mneName, mneUUID string, opt *
return client.AddList(ctx, req)
}
// AddNetworkElementList adds all the network elements to the controller. The name of each network element is optional.
// If no name is provided a name will be generated upon network element creation.
func AddNetworkElementList(ctx context.Context, addr, pid string, mneList []*mnepb.SetMne) (*mnepb.AddListResponse, error) {
client, err := nbi.NetworkElementClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &mnepb.AddListRequest{
Timestamp: time.Now().UnixNano(),
Mne: mneList,
Pid: pid,
}
return client.AddList(ctx, req)
}
// GetNetworkElement requests one network element belonging to a given
// PrincipalNetworkDomain from the controller. If no network element identifier
// is provided, an error is thrown.
@@ -72,6 +89,21 @@ func GetNetworkElement(ctx context.Context, addr, pid string, mneid string) (*mn
return client.Get(ctx, req)
}
// GetNetworkElements requests all available network elements related to one PND.
func GetNetworkElements(ctx context.Context, addr, pid string) (*mnepb.GetAllResponse, error) {
client, err := nbi.NetworkElementClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &mnepb.GetAllRequest{
Timestamp: time.Now().UnixNano(),
Pid: pid,
}
return client.GetAll(ctx, req)
}
// GetPluginSchemaTree gets the schema tree for a plugin.
func GetPluginSchemaTree(ctx context.Context, addr string, pluginID uuid.UUID) (map[string]*yang.Entry, error) {
pluginClient, err := nbi.PluginClient(addr, dialOptions...)
Loading