Skip to Content
Cloud Monitor(CloudWatch)QueryMetricDataSet

Query Monitoring Metric Data Set - QueryMetricDataSet

Overview

Query Monitoring Metrics Dataset

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is QueryMetricDataSet.Yes
PublicKeystringThe user’s public key can be obtained from Console Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See Region and Zone ListYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.Yes
ProductKeystringProductKey, SeeProduct Introduce Yes
StartTimeintStart Time,Value is a 10 digit timestampYes
EndTimeintEndTime,Value is a 10 digit timestampYes
CalcMethodstringCalcMethod,The enumeration values are: max, min, avg,sumYes
PeriodintPeriodYes
MetricInfos.N.MetricstringMetric NameYes
MetricInfos.N.ResourceIdstringMetric’s associated resource idYes
MetricInfos.N.TagList.N.TagKeystringThe key of the Tag of the metric to be queriedNo
MetricInfos.N.TagList.N.TagValues.NstringTo query the Value of the Tag of the metricNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
TraceIdstringLog Link IDNo
DataQueryMetricDataRespQueryMetricDataRespNo

Data Model

QueryMetricDataResp

Field NameTypeDescription InformationRequired
Listarray[QueryMetricDataRespItem]Query Result SetNo

QueryMetricDataRespItem

Field NameTypeDescription InformationRequired
MetricstringMetric NameNo
TagsobjectAll tag keys and corresponding value arrays of the metric query results.

The format of Tags is, the key is the tagkey string, and the value is an array of tagValue strings.
No
Resultsarray[MetricResult]No

MetricResult

Field NameTypeDescription InformationRequired
ResourceIdstringUUID of the resourceNo
TagMapobjectTagMap is an object, both key and value are strings.
TagMap returns the key and value of all tags of the current series.
No
Valuesarray[MetricSample]No

MetricSample

Field NameTypeDescription InformationRequired
TimestampinttimestampNo
ValuefloatSample ValueNo

Example

Request Example

https://api.surfercloud.com/?Action=QueryMetricDataSet &Region=cn-zj &Zone=cn-zj-01 &ProjectId=lBXDBARv &ProductKey=YoLcjjOJ &StartTime=2 &EndTime=1 &MetricInfos.N.Metric=wBhLvIzA &MetricInfos.N.ResourceId=pAlImMnm &MetricInfos.N.TagList.N.TagKey=bYSOyCNH &MetricInfos.N.TagList.N.TagValues.N=jNRAlNmm &CalcMethod=row &Period=60

Response Example

{ "Action": "QueryMetricDataSetResponse", "Data": { "InvalidResourceIds": [], "List": [ { "Metric": "uhost_cpu_used", "Results": [ { "ResourceId": "uhost-xxx", "ResourceName": "测试主机", "TagMap": {}, "Values": [ { "Timestamp": 1755593820, "Value": 3 }, { "Timestamp": 1755593880, "Value": 4 } ] } ], "Tags": {} } ] }, "RetCode": 0, "TraceId": "6b51655d-4c06-4da2-bd17-a5e6fff7ad0a" }