summaryrefslogtreecommitdiffhomepage
path: root/pkg/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-16 22:58:22 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-16 22:58:22 +0900
commitf0b724878360618dd0a950364709b048486771b6 (patch)
tree9b382035c4b759bd1567436e11ab0b91ff062d10 /pkg/server
parent0b6486f34ccbb16962ecd3d73e08a85c57fadde7 (diff)
pkt/server: ListPolicy() and ListStatement() support filtering like ListDefinedSet() and ListPolicyAassignment()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server')
-rw-r--r--pkg/server/server.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go
index 52624b97..356ebf23 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -3011,18 +3011,10 @@ func (s *BgpServer) ReplaceDefinedSet(ctx context.Context, r *api.ReplaceDefined
}, false)
}
-func (s *BgpServer) GetStatement() (l []*config.Statement) {
- s.mgmtOperation(func() error {
- l = s.policy.GetStatement()
- return nil
- }, false)
- return l
-}
-
func (s *BgpServer) ListStatement(ctx context.Context, r *api.ListStatementRequest) ([]*api.Statement, error) {
l := make([]*api.Statement, 0)
s.mgmtOperation(func() error {
- for _, st := range s.policy.GetStatement() {
+ for _, st := range s.policy.GetStatement(r.Name) {
l = append(l, toStatementApi(st))
}
return nil
@@ -3072,7 +3064,7 @@ func (s *BgpServer) ReplaceStatement(ctx context.Context, r *api.ReplaceStatemen
func (s *BgpServer) ListPolicy(ctx context.Context, r *api.ListPolicyRequest) ([]*api.Policy, error) {
l := make([]*api.Policy, 0)
s.mgmtOperation(func() error {
- for _, p := range s.policy.GetAllPolicy() {
+ for _, p := range s.policy.GetPolicy(r.Name) {
l = append(l, toPolicyApi(p))
}
return nil