Compare commits

...

4 Commits

Author SHA1 Message Date
b3b119c402 Merge branch '2-create-firewall-zone-api' 2025-04-13 19:39:29 +02:00
b4e2400bcf Another test 2025-04-13 19:39:16 +02:00
8974e82e78 Merge 2025-04-13 15:42:41 +02:00
01e89ca98d debug firewall zone api 2025-04-13 15:42:28 +02:00

View File

@@ -14,25 +14,23 @@ type FirewallZone struct {
// NoEdit bool `json:"attr_no_edit,omitempty"`
Name string `json:"name"`
Description string `json:"desc"`
DefaultZone bool `json:default_zone,omitempty`
NetworkIDs []string `json:network_ids,omitempty`
ZoneKey string `json:"zone_key,omitempty"`
// Role string `json:"role"`
}
func (c *Client) ListFirewallZones(ctx context.Context, site string) ([]FirewallZone, error) {
var respBody struct {
Meta meta `json:"meta"`
Data []FirewallZone `json:"data"`
}
var respBody []FirewallZone
err := c.do(ctx, "GET", fmt.Sprintf("site/%s/firewall/zone", site), nil, &respBody)
if err != nil {
return nil, err
}
return respBody.Data, nil
return respBody, nil
}
func (c *Client) GetFirewallZone(ctx context.Context, site, id string) (*FirewallZone, error) {