Skip to content
Snippets Groups Projects

Resolve "Requesting information from the Controller via NBI takes very long"

All threads resolved!
6 files
+ 73
3
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 13
1
@@ -75,7 +75,8 @@ func (p *PndAdapter) GetDevice(ctx context.Context, identifier string) (*ppb.Get
}
// GetDevices requests all devices belonging to the PrincipalNetworkDomain
// attached to this adapter.
// attached to this adapter. The requested devices also contain their config
// information as gNMI notifications.
func (p *PndAdapter) GetDevices(ctx context.Context) (*ppb.GetOndListResponse, error) {
resp, err := api.GetDevices(ctx, p.endpoint, p.id.String())
if err != nil {
@@ -84,6 +85,17 @@ func (p *PndAdapter) GetDevices(ctx context.Context) (*ppb.GetOndListResponse, e
return resp, nil
}
// GetFlattenedDevices requests all devices belonging to the PrincipalNetworkDomain
// attached to this adapter. The devices do not contain the config information
// as gNMI notifications.
func (p *PndAdapter) GetFlattenedDevices(ctx context.Context) (*ppb.GetFlattenedOndListResponse, error) {
resp, err := api.GetFlattenedDevices(ctx, p.endpoint, p.id.String())
if err != nil {
return nil, err
}
return resp, nil
}
// RemoveDevice removes a device from the controller
func (p *PndAdapter) RemoveDevice(ctx context.Context, did uuid.UUID) (*ppb.DeleteOndResponse, error) {
resp, err := api.DeleteDevice(ctx, p.endpoint, p.id.String(), did.String())
Loading