summaryrefslogtreecommitdiffhomepage
path: root/cmd/gobgpd
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-18 22:02:06 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-23 10:05:19 +0900
commit008c961ecd943739c5db63fcd931904804a45aa5 (patch)
treea56ebdc908ce1b387c030cf6223e7f5f5d76d5c8 /cmd/gobgpd
parent7e07240b292946c5fdd281fcc06d0cb8438c349a (diff)
policy cleanup
- remove ReplaceDefinedSet and ReplaceStatement APIs; not intutive and should create a new one instead of modifying the existing. - Rename ReplacePolicyAssignment to SetPolicyAssignment API; we use internally SetPolicy() name from the beginning. - Rename UpdatePolicy() to SetPolicies() API; It doesn't update anything so the name is confusing. It discards the all policies and create policies from the argument. - Changes some member names in structures for policy. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'cmd/gobgpd')
-rw-r--r--cmd/gobgpd/main.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go
index 463387b9..c212562c 100644
--- a/cmd/gobgpd/main.go
+++ b/cmd/gobgpd/main.go
@@ -273,9 +273,9 @@ func main() {
if err != nil {
log.Warn(err)
} else {
- apiServer.UpdatePolicy(context.Background(), &api.UpdatePolicyRequest{
- Sets: rp.DefinedSet,
- Policies: rp.PolicyDefinition,
+ apiServer.SetPolicies(context.Background(), &api.SetPoliciesRequest{
+ DefinedSets: rp.DefinedSets,
+ Policies: rp.Policies,
})
}
@@ -301,9 +301,9 @@ func main() {
if err != nil {
log.Warn(err)
} else {
- apiServer.UpdatePolicy(context.Background(), &api.UpdatePolicyRequest{
- Sets: rp.DefinedSet,
- Policies: rp.PolicyDefinition,
+ apiServer.SetPolicies(context.Background(), &api.SetPoliciesRequest{
+ DefinedSets: rp.DefinedSets,
+ Policies: rp.Policies,
})
}
}
@@ -332,7 +332,7 @@ func main() {
def := toDefaultTable(a.DefaultImportPolicy)
ps := toPolicies(a.ImportPolicyList)
- apiServer.ReplacePolicyAssignment(context.Background(), &api.ReplacePolicyAssignmentRequest{
+ apiServer.SetPolicyAssignment(context.Background(), &api.SetPolicyAssignmentRequest{
Assignment: server.NewAPIPolicyAssignmentFromTableStruct(&table.PolicyAssignment{
Name: table.GLOBAL_RIB_NAME,
Type: table.POLICY_DIRECTION_IMPORT,
@@ -343,7 +343,7 @@ func main() {
def = toDefaultTable(a.DefaultExportPolicy)
ps = toPolicies(a.ExportPolicyList)
- apiServer.ReplacePolicyAssignment(context.Background(), &api.ReplacePolicyAssignmentRequest{
+ apiServer.SetPolicyAssignment(context.Background(), &api.SetPolicyAssignmentRequest{
Assignment: server.NewAPIPolicyAssignmentFromTableStruct(&table.PolicyAssignment{
Name: table.GLOBAL_RIB_NAME,
Type: table.POLICY_DIRECTION_EXPORT,