Compare commits

...

4 Commits

Author SHA1 Message Date
db4af29aa6 Merge branch '2-create-firewall-zone-api' 2025-04-14 08:35:41 +02:00
db8d86a2c5 fix 2025-04-14 08:35:30 +02:00
5626d6341e Merge branch '2-create-firewall-zone-api' 2025-04-14 08:19:13 +02:00
825508ed03 debugging 2025-04-14 08:19:06 +02:00
2 changed files with 6 additions and 3 deletions

View File

@@ -14,8 +14,8 @@ type FirewallZone struct {
// NoEdit bool `json:"attr_no_edit,omitempty"` // NoEdit bool `json:"attr_no_edit,omitempty"`
Name string `json:"name"` Name string `json:"name"`
DefaultZone bool `json:default_zone,omitempty` DefaultZone bool `json:"default_zone,omitempty"`
NetworkIDs []string `json:network_ids,omitempty` NetworkIDs []string `json:"network_ids,omitempty"`
ZoneKey string `json:"zone_key,omitempty"` ZoneKey string `json:"zone_key,omitempty"`
// Role string `json:"role"` // Role string `json:"role"`

View File

@@ -13,6 +13,7 @@ import (
"path" "path"
"strings" "strings"
"sync" "sync"
"log"
) )
const ( const (
@@ -274,6 +275,8 @@ func (c *Client) do(ctx context.Context, method, relativeURL string, reqBody int
// TODO: check rc in addition to status code? // TODO: check rc in addition to status code?
log.Printf("%+v", respBody)
log.Printf("%+v", resp.Body)
err = json.NewDecoder(resp.Body).Decode(respBody) err = json.NewDecoder(resp.Body).Decode(respBody)
if err != nil { if err != nil {
return fmt.Errorf("unable to decode body: %s %s %w", method, relativeURL, err) return fmt.Errorf("unable to decode body: %s %s %w", method, relativeURL, err)