forked from linode/linodego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirewall_templates.go
More file actions
23 lines (19 loc) · 846 Bytes
/
firewall_templates.go
File metadata and controls
23 lines (19 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package linodego
import (
"context"
)
type FirewallTemplate struct {
Slug string `json:"slug"`
Rules FirewallRuleSet `json:"rules"`
}
// GetFirewallTemplate gets a FirewallTemplate given a slug.
// NOTE: This feature may not currently be available to all users.
func (c *Client) GetFirewallTemplate(ctx context.Context, slug string) (*FirewallTemplate, error) {
e := formatAPIPath("networking/firewalls/templates/%s", slug)
return doGETRequest[FirewallTemplate](ctx, c, e)
}
// ListFirewallTemplates gets all available firewall templates for the account.
// NOTE: This feature may not currently be available to all users.
func (c *Client) ListFirewallTemplates(ctx context.Context, opts *ListOptions) ([]FirewallTemplate, error) {
return getPaginatedResults[FirewallTemplate](ctx, c, "networking/firewalls/templates", opts)
}