-
Notifications
You must be signed in to change notification settings - Fork 7
/
logprofile.go
46 lines (38 loc) · 1009 Bytes
/
logprofile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package aws
import (
"github.com/paloaltonetworks/cloud-ngfw-aws-go/api/logprofile"
"context"
"net/http"
)
// Read returns information on the given object.
func (c *Client) ReadFirewallLogprofile(ctx context.Context, input logprofile.ReadInput) (logprofile.ReadOutput, error) {
name := input.Firewall
c.Log(http.MethodGet, "describe firewall log profile: %s", name)
var ans logprofile.ReadOutput
_, err := c.Communicate(
ctx,
PermissionFirewall,
http.MethodGet,
[]string{"v1", "config", "ngfirewalls", name, "logprofile"},
nil,
input,
&ans,
)
return ans, err
}
// Update updates the given object.
func (c *Client) UpdateFirewallLogprofile(ctx context.Context, input logprofile.Info) error {
name := input.Firewall
input.Firewall = ""
c.Log(http.MethodPut, "updating firewall log profile: %s", name)
_, err := c.Communicate(
ctx,
PermissionFirewall,
http.MethodPut,
[]string{"v1", "config", "ngfirewalls", name, "logprofile"},
nil,
input,
nil,
)
return err
}