@@ -19,6 +19,7 @@ package host
19
19
import (
20
20
"encoding/xml"
21
21
22
+ dyn "github.com/OpenNebula/one/src/oca/go/src/goca/dynamic"
22
23
"github.com/OpenNebula/one/src/oca/go/src/goca/schemas/shared"
23
24
)
24
25
@@ -30,65 +31,89 @@ type Pool struct {
30
31
31
32
// Host represents an OpenNebula Host
32
33
type Host struct {
33
- XMLName xml.Name `xml:"HOST"`
34
- ID int `xml:"ID,omitempty"`
35
- Name string `xml:"NAME"`
36
- StateRaw int `xml:"STATE,omitempty"`
37
- IMMAD string `xml:"IM_MAD,omitempty"`
38
- VMMAD string `xml:"VM_MAD,omitempty"`
39
- LastMonTime int `xml:"LAST_MON_TIME ,omitempty"`
40
- ClusterID int `xml:"CLUSTER_ID ,omitempty"`
41
- Cluster string `xml:"CLUSTER ,omitempty"`
42
- Share Share `xml:"HOST_SHARE ,omitempty"`
43
- VMs shared. EntitiesID `xml:"VMS ,omitempty"`
44
- Template Template `xml:"TEMPLATE,omitempty"`
34
+ XMLName xml.Name `xml:"HOST"`
35
+ ID int `xml:"ID,omitempty"`
36
+ Name string `xml:"NAME"`
37
+ StateRaw int `xml:"STATE,omitempty"`
38
+ IMMAD string `xml:"IM_MAD,omitempty"`
39
+ VMMAD string `xml:"VM_MAD,omitempty"`
40
+ ClusterID int `xml:"CLUSTER_ID ,omitempty"`
41
+ Cluster string `xml:"CLUSTER ,omitempty"`
42
+ Share Share `xml:"HOST_SHARE ,omitempty"`
43
+ VMs shared. EntitiesID `xml:"VMS ,omitempty"`
44
+ MonitoringInfos Monitoring `xml:"MONITORING ,omitempty"`
45
+ Template Template `xml:"TEMPLATE,omitempty"`
45
46
}
46
47
47
- type Share struct {
48
- DiskUsage int `xml:"DISK_USAGE,omitempty"`
49
- MemUsage int `xml:"MEM_USAGE,omitempty"`
50
- CPUUsage int `xml:"CPU_USAGE,omitempty"`
51
- TotalMem int `xml:"TOTAL_MEM,omitempty"`
52
- TotalCPU int `xml:"TOTAL_CPU,omitempty"`
53
-
54
- MaxDisk int `xml:"MAX_DISK,omitempty"`
55
- MaxMem int `xml:"MAX_MEM,omitempty"`
56
- MaxCPU int `xml:"MAX_CPU,omitempty"`
48
+ type Monitoring struct {
49
+ dyn.Template
50
+ }
57
51
58
- FreeDisk int `xml:"FREE_DISK,omitempty"`
59
- FreeMem int `xml:"FREE_MEM,omitempty"`
60
- FreeCPU int `xml:"FREE_CPU,omitempty"`
52
+ type Share struct {
53
+ MemUsage int `xml:"MEM_USAGE,omitempty"`
54
+ CPUUsage int `xml:"CPU_USAGE,omitempty"`
55
+ TotalMem int `xml:"TOTAL_MEM,omitempty"`
56
+ TotalCPU int `xml:"TOTAL_CPU,omitempty"`
61
57
62
- UsedDisk int `xml:"USED_DISK,omitempty"`
63
- UsedMem int `xml:"USED_MEM,omitempty"`
64
- UsedCPU int `xml:"USED_CPU,omitempty"`
58
+ MaxMem int `xml:"MAX_MEM,omitempty"`
59
+ MaxCPU int `xml:"MAX_CPU,omitempty"`
65
60
66
61
RunningVMs int `xml:"RUNNING_VMS,omitempty"`
67
- Datastores []Datastores `xml:"DATASTORES>DS,omitempty"`
68
- PCIDevices []PCIDevices `xml:"PCI_DEVICES>PCI,omitempty"`
62
+ Datastores Datastores `xml:"DATASTORES,omitempty"`
63
+ NumaNodes []NumaNode `xml:"NUMA_NODES>NODE,omitempty"`
64
+ PCIDevices []PCIDevices `xml:"PCI_DEVICES>PCI,omitempty"`
69
65
}
70
66
71
67
type Datastores struct {
72
- ID int `xml:"ID ,omitempty"`
73
- UsedMB int `xml:"USED_MB ,omitempty"`
74
- FreeMB int `xml:"FREE_MB ,omitempty"`
75
- TotalMB int `xml:"TOTAL_MB ,omitempty"`
68
+ DiskUsage int `xml:"DISK_USAGE ,omitempty"`
69
+ FreeDisk int `xml:"FREE_DISK ,omitempty"`
70
+ MaxDisk int `xml:"MAX_DISK ,omitempty"`
71
+ UsedDisk int `xml:"USED_DISK ,omitempty"`
76
72
}
77
73
78
74
type PCIDevices struct {
79
- Address string `xml:"ADDRESS,omitempty"`
80
- Bus string `xml:"BUS,omitempty"`
81
- Class string `xml:"CLASS,omitempty"`
82
- ClassName string `xml:"CLASS_NAME,omitempty"`
83
- Device string `xml:"DEVICE,omitempty"`
84
- DeviceName string `xml:"DEVICE_NAME,omitempty"`
85
- Domain string `xml:"DOMAIN,omitempty"`
86
- Function string `xml:"FUNCTION,omitempty"`
87
- NumaNode string `xml:"NUMA_NODE,omitempty"`
88
- ShortAddress string `xml:"SHORT_ADDRESS,omitempty"`
89
- Slot string `xml:"SLOT,omitempty"`
90
- Type string `xml:"TYPE,omitempty"`
91
- Vendor string `xml:"VENDOR,omitempty"`
92
- VendorName string `xml:"VENDOR_NAME,omitempty"`
93
- VMID int `xml:"VMID,omitempty"`
75
+ Address string `xml:"ADDRESS,omitempty"`
76
+ Bus string `xml:"BUS,omitempty"`
77
+ Class string `xml:"CLASS,omitempty"`
78
+ ClassName string `xml:"CLASS_NAME,omitempty"`
79
+ Device string `xml:"DEVICE,omitempty"`
80
+ DeviceName string `xml:"DEVICE_NAME,omitempty"`
81
+ Domain string `xml:"DOMAIN,omitempty"`
82
+ Function string `xml:"FUNCTION,omitempty"`
83
+ NumaNodes []NumaNode `xml:"NUMA_NODE,omitempty"`
84
+ ShortAddress string `xml:"SHORT_ADDRESS,omitempty"`
85
+ Slot string `xml:"SLOT,omitempty"`
86
+ Type string `xml:"TYPE,omitempty"`
87
+ Vendor string `xml:"VENDOR,omitempty"`
88
+ VendorName string `xml:"VENDOR_NAME,omitempty"`
89
+ VMID int `xml:"VMID,omitempty"`
90
+ }
91
+
92
+ type NumaNode struct {
93
+ ID int `xml:"NODE_ID,omitempty"`
94
+ Cores []Core `xml:"CORE,omitempty"`
95
+ HugePages []HugePage `xml:"HUGEPAGE,omitempty"`
96
+ Memories []Memory `xml:"MEMORY,omitempty"`
97
+ }
98
+
99
+ type HugePage struct {
100
+ Free int `xml:"FREE,omitempty"`
101
+ Pages int `xml:"PAGES,omitempty"`
102
+ Size int `xml:"SIZE,omitempty"`
103
+ Usage int `xml:"USAGE,omitempty"`
104
+ }
105
+
106
+ type Memory struct {
107
+ Distance string `xml:"DISTANCE,omitempty"`
108
+ Free int `xml:"FREE,omitempty"`
109
+ Total int `xml:"TOTAL,omitempty"`
110
+ Usage int `xml:"USAGE,omitempty"`
111
+ Used int `xml:"USED,omitempty"`
112
+ }
113
+
114
+ type Core struct {
115
+ ID int `xml:"ID,omitempty"`
116
+ CPUs string `xml:"CPUS,omitempty"`
117
+ Dedicated string `xml:"DEDICATED,omitempty"`
118
+ Free int `xml:"FREE,omitempty"`
94
119
}
0 commit comments