Skip to content

Commit

Permalink
Extend example to delete security policy rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianczech committed Apr 8, 2024
1 parent 2aed28c commit f04fa33
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions assets/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
return
}

// SECURITY POLICY RULE
// SECURITY POLICY RULE - ADD
securityPolicyRuleName := "codegen_rule"
securityPolicyRuleAction := "allow"
securityPolicyRuleSourceZones := []string{"any"}
Expand All @@ -59,7 +59,15 @@ func main() {
log.Printf("Failed to create security policy rule: %s", err)
return
}
log.Printf("Security policy rule '%s' created", securityPolicyRuleReply.Name)
log.Printf("Security policy rule '%s:%s' created", *securityPolicyRuleReply.Uuid, securityPolicyRuleReply.Name)

// SECURITY POLICY RULE - DELETE
err = securityPolicyRuleApi.Delete(ctx, securityPolicyRuleLocation, securityPolicyRuleName)
if err != nil {
log.Printf("Failed to delete security policy rule: %s", err)
return
}
log.Printf("Security policy rule '%s' deleted", securityPolicyRuleName)

// TAG - CREATE
tagName := "codegen_color"
Expand Down

0 comments on commit f04fa33

Please sign in to comment.