diff --git a/types.go b/types.go index 4209f16..1b58dd6 100644 --- a/types.go +++ b/types.go @@ -980,16 +980,16 @@ type FirewallNodeOption struct { } type FirewallVirtualMachineOption struct { - Enable bool `json:"enable,omitempty"` - Dhcp bool `json:"dhcp,omitempty"` - Ipfilter bool `json:"ipfilter,omitempty"` - LogLevelIn string `json:"log_level_in,omitempty"` - LogLevelOut string `json:"log_level_out,omitempty"` - Macfilter bool `json:"macfilter,omitempty"` - Ntp bool `json:"ntp,omitempty"` - PolicyIn string `json:"policy_in,omitempty"` - PolicyOut string `json:"policy_out,omitempty"` - Radv bool `json:"radv,omitempty"` + Enable *IntOrBool `json:"enable,omitempty"` + Dhcp *IntOrBool `json:"dhcp,omitempty"` + IpFilter *IntOrBool `json:"ipfilter,omitempty"` + LogLevelIn *string `json:"log_level_in,omitempty"` + LogLevelOut *string `json:"log_level_out,omitempty"` + MacFilter *IntOrBool `json:"macfilter,omitempty"` + Ndp *IntOrBool `json:"ndp,omitempty"` + PolicyIn *string `json:"policy_in,omitempty"` + PolicyOut *string `json:"policy_out,omitempty"` + Radv *IntOrBool `json:"radv,omitempty"` } type Snapshot struct { diff --git a/virtual_machine.go b/virtual_machine.go index 4915f72..b40af0c 100644 --- a/virtual_machine.go +++ b/virtual_machine.go @@ -569,9 +569,14 @@ func (v *VirtualMachine) AgentSetUserPassword(ctx context.Context, password stri return v.client.Post(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/agent/set-user-password", v.Node, v.VMID), map[string]string{"password": password, "username": username}, nil) } -func (v *VirtualMachine) FirewallOptionGet(ctx context.Context) (firewallOption *FirewallVirtualMachineOption, err error) { - err = v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/options", v.Node, v.VMID), firewallOption) - return +func (v *VirtualMachine) FirewallOptionGet(ctx context.Context) (*FirewallVirtualMachineOption, error) { + firewallOption := FirewallVirtualMachineOption{} + + if err := v.client.Get(ctx, fmt.Sprintf("/nodes/%s/qemu/%d/firewall/options", v.Node, v.VMID), &firewallOption); err != nil { + return nil, err + } + + return &firewallOption, nil } func (v *VirtualMachine) FirewallOptionSet(ctx context.Context, firewallOption *FirewallVirtualMachineOption) error {