You can call this operation to query the time series metric data of cloud services in a specified period of time.

Parameters of cloud products namespace, project, metric, period, dimensions for more information, seedescribeMetricMetaList orcloudMonitor metrics.

Note This interface and describeMetricList moreover, this operation has a statistical function, that is, Dimension={"userId:" xxxx "}, which aggregates all data of this user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Parameters

Parameter Type Required Example Description
Action String Yes DescribeMetricData

The operation that you want to perform. Set the value to describeMetricData.

MetricName String Yes cpu_idle

The name of the metric.

Namespace String Yes acs_ecs_dashboard

The data namespace of the service.

Naming format: acs_product name.

Period String No 60

The interval. Unit: seconds. Valid values: 60(1 minute), 300(5 minutes), and 900(15 minutes).

Set this parameter as needed. For example:

  • If you set this parameter when querying for a day range, period if the value is 60, 1,000 data entries are returned. If 1440 data entries actually exist, only the first 1,000 data entries are returned because the maximum return value cannot exceed 1,000.
  • If period if the value is 300, 288 data entries are returned.
StartTime String No 2019-01-30 00:00:00

Start time. Supported formats:

  • Unix timestamp: the number of seconds that have elapsed since January 1, 1970.
  • Format: YYYY-MM-DDThh:mm:ssZ.
Note The period specified by startTime and endTime includes the time point specified by startTime but does not include the time point specified by endTime. startTime must be earlier than endTime.
EndTime String No 2019-01-30 00:10:00

The end time. Supported formats:

  • Unix timestamp: the number of seconds that have elapsed since January 1, 1970.
  • Format: YYYY-MM-DDThh:mm:ssZ.
Dimensions String No [{"instanceId": "i-abcdefgh12****"}]

You can call this operation to query the monitoring data of a specified resource.

The format is key-value A collection of key-value pairs. key-value set to instanceId:XXXXXX.

Key and value must be 1 to 64 bytes in length. Excess bytes are truncated from the string. Key and value the value of can contain letters, numbers, periods (.), hyphen (-), underscores (_), forward slashes (/), and backslashes (\).

Note Dimensions the Map must be passed in JSON strings in sequence.
Express String No "{"groupby":["userId","instanceId"]}"

The expression used for real-time computation based on the queried results.

Currently, only groupby(Similar to the database's groupby statement).

Length String No 1000

The number of records to return on each page. It is used in paged queries.

Default value: 1000.

Response Data

Parameter Type Example Description
Code String 200

Status code.

Note Status Code 200 indicates success, and other values indicate failure.
Datapoints String [{"timestamp":1548777660000,"userId":"123****","instanceId":"i-abc****","Minimum":9.92,"Average":9.92,"Maximum":9.92}]

The list of monitoring data.

Message String Success

The returned information.

Period String 60

The interval. Unit: seconds. Valid values: 60, 300, and 900.

RequestId String 6 A5F022 D-AC7C-460E-94AE-B9E75083D027

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeMetricData
&MetricName=cpu_idle
&Namespace=acs_ecs_dashboard
&<common request parameters>

Sample success responses

XML format

<Period>60</Period>
<Datapoints>
    <timestamp>1490152860000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>93.1</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.52</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490152920000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>92.59</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.49</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490152980000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>92.86</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.44</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153040000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>91.43</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.36</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153100000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>93.55</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.51</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153160000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>93.1</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.52</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153220000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>92.59</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.42</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153280000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>91.18</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.34</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153340000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>92.86</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.46</Average>
</Datapoints>
<Datapoints>
    <timestamp>1490153400000</timestamp>
    <Maximum>100</Maximum>
    <userId>123456789876****</userId>
    <Minimum>91.18</Minimum>
    <instanceId>i-abcdefgh12****</instanceId>
    <Average>99.35</Average>
</Datapoints>
<RequestId>6A5F022D-AC7C-460E-94AE-B9E75083D027</RequestId>
<Code>200</Code>

JSON format

{
    &quot;Period&quot;: &quot;60&quot;,
    &quot;Datapoints&quot;: [
        {
            &quot;timestamp&quot;: 1490152860000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 93.1,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.52
        },
        {
            &quot;timestamp&quot;: 1490152920000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 92.59,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.49
        },
        {
            &quot;timestamp&quot;: 1490152980000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 92.86,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.44
        },
        {
            &quot;timestamp&quot;: 1490153040000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 91.43,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.36
        },
        {
            &quot;timestamp&quot;: 1490153100000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 93.55,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.51
        },
        {
            &quot;timestamp&quot;: 1490153160000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 93.1,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.52
        },
        {
            &quot;timestamp&quot;: 1490153220000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 92.59,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.42
        },
        {
            &quot;timestamp&quot;: 1490153280000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 91.18,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.34
        },
        {
            &quot;timestamp&quot;: 1490153340000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 92.86,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.46
        },
        {
            &quot;timestamp&quot;: 1490153400000,
            &quot;Maximum&quot;: 100,
            &quot;userId&quot;: &quot;123456789876****&quot;,
            &quot;Minimum&quot;: 91.18,
            &quot;instanceId&quot;: &quot;i-abcdefgh12****&quot;,
            &quot;Average&quot;: 99.35
        }
    ],
    &quot;RequestId&quot;: &quot;6A5F022D-AC7C-460E-94AE-B9E75083D027&quot;,
    &quot;Code&quot;: &quot;200&quot;
}

Error code

Access error Center for more error codes.