Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package api
import (
"context"
"time"
ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd"
nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
)
// GetSbi requests one or more to the provided PND belonging SBIs from the
// controller.
func GetSbi(ctx context.Context, addr string, pid string, sid ...string) (*ppb.GetSbiResponse, error) {
client, err := nbi.PndClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &ppb.GetSbiRequest{
Timestamp: time.Now().UnixNano(),
Pid: pid,
Sid: sid,
}
return client.GetSbi(ctx, req)
}
//GetSBIs requests all to the provided PND belonging SBIs from the controller.
func GetSBIs(ctx context.Context, addr string, pid string) (*ppb.GetSbiListResponse, error) {
client, err := nbi.PndClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &ppb.GetSbiListRequest{
Timestamp: time.Now().UnixNano(),
Pid: pid,
}
return client.GetSbiList(ctx, req)
}