Exemple #1
0
func (cli *GoBGPClient) AddPolicy(t *table.Policy, refer bool) error {
	a := api.NewAPIPolicyFromTableStruct(t)
	_, err := cli.cli.AddPolicy(context.Background(), &api.AddPolicyRequest{
		Policy:                  a,
		ReferExistingStatements: refer,
	})
	return err
}
Exemple #2
0
func (cli *GoBGPClient) DeletePolicy(t *table.Policy, all, preserve bool) error {
	a := api.NewAPIPolicyFromTableStruct(t)
	_, err := cli.cli.DeletePolicy(context.Background(), &api.DeletePolicyRequest{
		Policy:             a,
		All:                all,
		PreserveStatements: preserve,
	})
	return err
}