Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
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
2 changes: 1 addition & 1 deletion openstack/ces/v1/metricdata/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Metric struct {
MetricName string `json:"metric_name" required:"true"`

// Specifies the list of the metric dimensions.
Dimensions []map[string]string `json:"dimensions" required:"true"`
Dimensions []Dimension `json:"dimensions" required:"true"`
}

// BatchQueryOpts represents options for batch query metric data.
Expand Down
16 changes: 12 additions & 4 deletions openstack/ces/v1/metricdata/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ type MetricData struct {
MetricName string `json:"metric_name"`

//Specifies the list of the metric dimensions.
Dimensions []map[string]interface{} `json:"dimensions"`

// Specifies the metric data list.
Datapoints []map[string]interface{} `json:"datapoints"`
Dimensions []Dimension `json:"dimensions"`
Datapoints []Data `json:"datapoints"`

// Specifies the metric unit.
Unit string `json:"unit"`
}

type Dimension struct {
Name string `json:"name"`
Value string `json:"value"`
}

type Data struct {
Average float64 `json:"average"`
Timestamp int `json:"timestamp"`
}

type MetricDatasResult struct {
golangsdk.Result
}
Expand Down