Skip to content

Commit 740c167

Browse files
committed
expose some field
1 parent 65dd897 commit 740c167

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

proxmox/qemu.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313

1414
type VirtualMachine struct {
1515
restclient *rest.RESTClient
16-
node string
17-
vm *api.VirtualMachine
16+
Node string
17+
VM *api.VirtualMachine
1818
config *api.VirtualMachineConfig
1919
}
2020

@@ -52,7 +52,7 @@ func (s *Service) NewVirtualMachine(ctx context.Context, vmid int) (*VirtualMach
5252
}
5353
return nil, err
5454
}
55-
return &VirtualMachine{restclient: s.restclient, vm: vm, node: node.Node}, nil
55+
return &VirtualMachine{restclient: s.restclient, VM: vm, Node: node.Node}, nil
5656
}
5757
return nil, rest.NotFoundErr
5858
}
@@ -77,7 +77,7 @@ func (s *Service) VirtualMachineFromUUID(ctx context.Context, uuid string) (*Vir
7777
return nil, err
7878
}
7979
if vmuuid == uuid {
80-
return &VirtualMachine{restclient: s.restclient, vm: vm, node: node.Node, config: config}, nil
80+
return &VirtualMachine{restclient: s.restclient, VM: vm, Node: node.Node, config: config}, nil
8181
}
8282
}
8383
}
@@ -98,7 +98,7 @@ func (c *VirtualMachine) GetConfig(ctx context.Context) (*api.VirtualMachineConf
9898
if c.config != nil {
9999
return c.config, nil
100100
}
101-
config, err := c.restclient.GetVirtualMachineConfig(ctx, c.node, c.vm.VMID)
101+
config, err := c.restclient.GetVirtualMachineConfig(ctx, c.Node, c.VM.VMID)
102102
if err != nil {
103103
return nil, err
104104
}
@@ -108,7 +108,7 @@ func (c *VirtualMachine) GetConfig(ctx context.Context) (*api.VirtualMachineConf
108108

109109
func (c *VirtualMachine) GetOSInfo(ctx context.Context) (*api.OSInfo, error) {
110110
var osInfo *api.OSInfo
111-
path := fmt.Sprintf("/nodes/%s/qemu/%d/agent/get-osinfo", c.node, c.vm.VMID)
111+
path := fmt.Sprintf("/nodes/%s/qemu/%d/agent/get-osinfo", c.Node, c.VM.VMID)
112112
if err := c.restclient.Get(ctx, path, &osInfo); err != nil {
113113
return nil, err
114114
}

0 commit comments

Comments
 (0)