Skip to content

Commit b471df6

Browse files
committed
Fix VM Usage histroy response
1 parent b8e58e9 commit b471df6

File tree

6 files changed

+73492
-73249
lines changed

6 files changed

+73492
-73249
lines changed

cloudstack/SystemVMService.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,12 +1085,29 @@ type ListSystemVmsUsageHistoryResponse struct {
10851085
}
10861086

10871087
type SystemVmsUsageHistory struct {
1088-
Displayname string `json:"displayname"`
1089-
Id string `json:"id"`
1090-
JobID string `json:"jobid"`
1091-
Jobstatus int `json:"jobstatus"`
1092-
Name string `json:"name"`
1093-
Stats []string `json:"stats"`
1088+
Displayname string `json:"displayname"`
1089+
Id string `json:"id"`
1090+
JobID string `json:"jobid"`
1091+
Jobstatus int `json:"jobstatus"`
1092+
Name string `json:"name"`
1093+
Stats []SystemVmsUsageHistoryStats `json:"stats"`
1094+
}
1095+
1096+
type SystemVmsUsageHistoryStats struct {
1097+
Cpuused string `json:"cpuused"`
1098+
Diskiopstotal int64 `json:"diskiopstotal"`
1099+
Diskioread int64 `json:"diskioread"`
1100+
Diskiowrite int64 `json:"diskiowrite"`
1101+
Diskkbsread int64 `json:"diskkbsread"`
1102+
Diskkbswrite int64 `json:"diskkbswrite"`
1103+
Memoryintfreekbs int64 `json:"memoryintfreekbs"`
1104+
Memorykbs int64 `json:"memorykbs"`
1105+
Memorytargetkbs int64 `json:"memorytargetkbs"`
1106+
Networkkbsread int64 `json:"networkkbsread"`
1107+
Networkkbswrite int64 `json:"networkkbswrite"`
1108+
Networkread string `json:"networkread"`
1109+
Networkwrite string `json:"networkwrite"`
1110+
Timestamp string `json:"timestamp"`
10941111
}
10951112

10961113
type MigrateSystemVmParams struct {

cloudstack/VirtualMachineService.go

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10752,16 +10752,33 @@ func (s *VirtualMachineService) ListVirtualMachinesUsageHistory(p *ListVirtualMa
1075210752

1075310753
type ListVirtualMachinesUsageHistoryResponse struct {
1075410754
Count int `json:"count"`
10755-
VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:"virtualmachinesusagehistory"`
10755+
VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:"virtualmachine"`
1075610756
}
1075710757

1075810758
type VirtualMachinesUsageHistory struct {
10759-
Displayname string `json:"displayname"`
10760-
Id string `json:"id"`
10761-
JobID string `json:"jobid"`
10762-
Jobstatus int `json:"jobstatus"`
10763-
Name string `json:"name"`
10764-
Stats []string `json:"stats"`
10759+
Displayname string `json:"displayname"`
10760+
Id string `json:"id"`
10761+
JobID string `json:"jobid"`
10762+
Jobstatus int `json:"jobstatus"`
10763+
Name string `json:"name"`
10764+
Stats []VirtualMachinesUsageHistoryStats `json:"stats"`
10765+
}
10766+
10767+
type VirtualMachinesUsageHistoryStats struct {
10768+
Cpuused string `json:"cpuused"`
10769+
Diskiopstotal int64 `json:"diskiopstotal"`
10770+
Diskioread int64 `json:"diskioread"`
10771+
Diskiowrite int64 `json:"diskiowrite"`
10772+
Diskkbsread int64 `json:"diskkbsread"`
10773+
Diskkbswrite int64 `json:"diskkbswrite"`
10774+
Memoryintfreekbs int64 `json:"memoryintfreekbs"`
10775+
Memorykbs int64 `json:"memorykbs"`
10776+
Memorytargetkbs int64 `json:"memorytargetkbs"`
10777+
Networkkbsread int64 `json:"networkkbsread"`
10778+
Networkkbswrite int64 `json:"networkkbswrite"`
10779+
Networkread string `json:"networkread"`
10780+
Networkwrite string `json:"networkwrite"`
10781+
Timestamp string `json:"timestamp"`
1076510782
}
1076610783

1076710784
type ImportVmParams struct {

cloudstack/cloudstack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"strings"
4040
"time"
4141

42-
gomock "go.uber.org/mock/gomock"
42+
gomock "go.uber.org/mock/gomock"
4343
)
4444

4545
// UnlimitedResourceID is a special ID to define an unlimited resource

generate/generate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,9 @@ func (s *service) generateResponseType(a *API) {
20142014
case "listSecondaryStorageSelectors":
20152015
pn(" Count int `json:\"count\"`")
20162016
pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "heuristics")
2017+
case "listVirtualMachinesUsageHistory":
2018+
pn(" Count int `json:\"count\"`")
2019+
pn(" VirtualMachinesUsageHistory []*VirtualMachinesUsageHistory `json:\"virtualmachine\"`")
20172020
case "listHostHAResources":
20182021
pn(" Count int `json:\"count\"`")
20192022
pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "hostha")

0 commit comments

Comments
 (0)