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
package api
import (
"context"
"time"
subpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/subscriptionmanagement"
nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
)
// ResetAllSubscriptions stops all running subscriptions and restarts them the same way they ran before.
func ResetAllSubscriptions(ctx context.Context, addr string) (*subpb.ResetAllSubscriptionsResponse, error) {
subClient, err := nbi.SubManagementClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &subpb.ResetAllSubscriptionsRequest{
Timestamp: time.Now().UnixNano(),
}
return subClient.ResetAllSubscriptions(ctx, req)
}
// GetAll returns information about all running subscriptions.
func GetAll(ctx context.Context, addr string) (*subpb.GetAllResponse, error) {
subClient, err := nbi.SubManagementClient(addr, dialOptions...)
if err != nil {
return nil, err
}
req := &subpb.GetAllRequest{
Timestamp: time.Now().UnixNano(),
}
return subClient.GetAll(ctx, req)
}