Fix JSON tag mismatch for metrics list responses Add generator cases for listClustersMetrics, listHostsMetrics, listVolumesMetrics, and listZonesMetrics so their response tags match the live server keys (cluster, host, volume, zone) and survive regeneration. Restructure listUsageServerMetrics into a single-object response tagged usageMetrics, matching the actual server payload shape instead of the previous list/count shape that never matched.
diff --git a/cloudstack/ClusterService.go b/cloudstack/ClusterService.go index 1e10470..e16583d 100644 --- a/cloudstack/ClusterService.go +++ b/cloudstack/ClusterService.go
@@ -2686,7 +2686,7 @@ type ListClustersMetricsResponse struct { Count int `json:"count"` - ClustersMetrics []*ClustersMetric `json:"clustersmetric"` + ClustersMetrics []*ClustersMetric `json:"cluster"` } type ClustersMetric struct {
diff --git a/cloudstack/HostService.go b/cloudstack/HostService.go index 16f9009..07cd9a8 100644 --- a/cloudstack/HostService.go +++ b/cloudstack/HostService.go
@@ -4118,7 +4118,7 @@ type ListHostsMetricsResponse struct { Count int `json:"count"` - HostsMetrics []*HostsMetric `json:"hostsmetric"` + HostsMetrics []*HostsMetric `json:"host"` } type HostsMetric struct {
diff --git a/cloudstack/UsageService.go b/cloudstack/UsageService.go index ef89ced..f15c91d 100644 --- a/cloudstack/UsageService.go +++ b/cloudstack/UsageService.go
@@ -2128,8 +2128,7 @@ } type ListUsageServerMetricsResponse struct { - Count int `json:"count"` - UsageServerMetrics []*UsageServerMetric `json:"usageservermetric"` + UsageServerMetrics UsageServerMetric `json:"usageMetrics"` } type UsageServerMetric struct {
diff --git a/cloudstack/VolumeService.go b/cloudstack/VolumeService.go index c9158aa..cb85b7a 100644 --- a/cloudstack/VolumeService.go +++ b/cloudstack/VolumeService.go
@@ -4466,7 +4466,7 @@ type ListVolumesMetricsResponse struct { Count int `json:"count"` - VolumesMetrics []*VolumesMetric `json:"volumesmetric"` + VolumesMetrics []*VolumesMetric `json:"volume"` } type VolumesMetric struct {
diff --git a/cloudstack/ZoneService.go b/cloudstack/ZoneService.go index 8ae1e10..7da52ce 100644 --- a/cloudstack/ZoneService.go +++ b/cloudstack/ZoneService.go
@@ -3076,7 +3076,7 @@ type ListZonesMetricsResponse struct { Count int `json:"count"` - ZonesMetrics []*ZonesMetric `json:"zonesmetric"` + ZonesMetrics []*ZonesMetric `json:"zone"` } type ZonesMetric struct {
diff --git a/generate/generate.go b/generate/generate.go index 448b614..08b444e 100644 --- a/generate/generate.go +++ b/generate/generate.go
@@ -2032,6 +2032,20 @@ pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "managementserver") case "listDbMetrics": pn(" %s %s `json:\"%s\"`", ln, parseSingular(ln), "dbMetrics") + case "listUsageServerMetrics": + pn(" %s %s `json:\"%s\"`", ln, parseSingular(ln), "usageMetrics") + case "listClustersMetrics": + pn(" Count int `json:\"count\"`") + pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "cluster") + case "listHostsMetrics": + pn(" Count int `json:\"count\"`") + pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "host") + case "listVolumesMetrics": + pn(" Count int `json:\"count\"`") + pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "volume") + case "listZonesMetrics": + pn(" Count int `json:\"count\"`") + pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "zone") case "registerTemplate": pn(" Count int `json:\"count\"`") pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "template")