Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cloudstack/BackupService.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,7 @@ func (p *CreateVMFromBackupParams) toURLValues() url.Values {
if v, found := p.p["userdatadetails"]; found {
m := v.(map[string]string)
for i, k := range getSortedKeysFromMap(m) {
u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
}
}
if v, found := p.p["userdataid"]; found {
Expand Down
2 changes: 1 addition & 1 deletion cloudstack/VirtualMachineService.go
Original file line number Diff line number Diff line change
Expand Up @@ -11450,7 +11450,7 @@ func (s *VirtualMachineService) ListVirtualMachinesUsageHistory(p *ListVirtualMa

type ListVirtualMachinesUsageHistoryResponse struct {
Count int `json:"count"`
VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:"virtualmachinesusagehistory"`
VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:"virtualmachine"`
}

type VirtualMachinesUsageHistory struct {
Expand Down
3 changes: 3 additions & 0 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,9 @@ func (s *service) generateResponseType(a *API) {
case "listSecondaryStorageSelectors":
pn(" Count int `json:\"count\"`")
pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "heuristics")
case "listVirtualMachinesUsageHistory":
pn(" Count int `json:\"count\"`")
pn(" VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:\"virtualmachine\"`")
case "listHostHAResources":
pn(" Count int `json:\"count\"`")
pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "hostha")
Expand Down
64 changes: 63 additions & 1 deletion test/testdata/VirtualMachineService.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,5 +505,67 @@
"completed": "2021-10-13T04:54:56+0000",
"jobid": "f9a9af61-47ea-4fb7-acc9-93ea50f12042"
}
},
"listVirtualMachinesUsageHistory": {
"listvirtualmachinesusagehistoryresponse": {
"count": 1,
"virtualmachine": [
{
"id": "4f6d7879-8e9d-40cb-9390-28924a31df78",
"name": "i-5-39-VM",
"displayname": "ubuntu-01",
"stats": [
{
"timestamp": "2024-12-31T17:54:37+0600",
"cpuused": "55.56%",
"diskioread": 0,
"diskiowrite": 0,
"diskiopstotal": 0,
"diskkbsread": 0,
"diskkbswrite": 0,
"memoryintfreekbs": 182168,
"memorykbs": 1048576,
"memorytargetkbs": 1048576,
"networkkbsread": 0,
"networkkbswrite": 0,
"networkread": "0.00 MiB",
"networkwrite": "0.00 MiB"
},
{
"timestamp": "2024-12-31T17:54:37+0600",
"cpuused": "0.2%",
"diskioread": 0,
"diskiowrite": 0,
"diskiopstotal": 0,
"diskkbsread": 0,
"diskkbswrite": 0,
"memoryintfreekbs": 182168,
"memorykbs": 1048576,
"memorytargetkbs": 1048576,
"networkkbsread": 0,
"networkkbswrite": 0,
"networkread": "0.00 MiB",
"networkwrite": "0.00 MiB"
},
{
"timestamp": "2024-12-31T17:54:37+0600",
"cpuused": "11.43%",
"diskioread": 0,
"diskiowrite": 0,
"diskiopstotal": 0,
"diskkbsread": 0,
"diskkbswrite": 0,
"memoryintfreekbs": 182168,
"memorykbs": 1048576,
"memorytargetkbs": 1048576,
"networkkbsread": 0,
"networkkbswrite": 0,
"networkread": "0.00 MiB",
"networkwrite": "0.00 MiB"
}
]
}
]
}
}
}
}
Loading