2021-10-25 12:17:34 +00:00
|
|
|
package service
|
|
|
|
|
2021-12-10 16:55:49 +00:00
|
|
|
func (c *Client) CreateGlobalPolicy(name, query, description, resolution, platform string) error {
|
2021-10-25 12:17:34 +00:00
|
|
|
req := globalPolicyRequest{
|
2021-12-10 16:55:49 +00:00
|
|
|
Name: name,
|
|
|
|
Query: query,
|
|
|
|
Description: description,
|
|
|
|
Resolution: resolution,
|
|
|
|
Platform: platform,
|
2021-10-25 12:17:34 +00:00
|
|
|
}
|
2022-04-05 15:35:53 +00:00
|
|
|
verb, path := "POST", "/api/latest/fleet/global/policies"
|
2021-10-25 12:17:34 +00:00
|
|
|
var responseBody globalPolicyResponse
|
|
|
|
return c.authenticatedRequest(req, verb, path, &responseBody)
|
|
|
|
}
|