DescribeInstanceMonitorData

Last Updated: Sep 13, 2017

Description

Query all the ECS-related monitoring information by page.

  • Only monitoring information for an ECS that is not in the Deleted state or that is still in the Stopped state can be queried.
  • The monitoring information that can be returned includes: The CPU usage of the ECS, memory count allocated to the ECS, data traffic received by the ECS, data traffic sent by the ECS, ECS network traffic, and ECS average bandwidth. Some portion may be missing from the returned monitoring data. This may be due to the fact that the system has not obtained the relevant information, for example, when an instance is in the Stopped status.
  • At one time, up to 400 monitoring data entries can be returned. If the specified (EndTime - StartTime)/ Period > 400, an error is returned.
  • At one time, up to 30 days monitoring data entries can be queried. If the specified StartTime is earlier than 30 days, an error is returned.

Request Parameters

Name Type Required? Description
Action String Yes Required parameter, with a value: DescribeInstanceMonitorData.
InstanceId String Yes The specified monitoring instance ID.
StartTime String Yes The start time of the retrieved data: which is represented according to ISO8601, and UTC is required. Supported format: YYYY-MM-DDThh:mm:ssZ.
If the seconds place is not 00, it is automatically set to start of the next minute.
EndTime String Yes The end time of the retrieved data: which is represented according to ISO8601, and UTC is required. Supported format: YYYY-MM-DDThh:mm:ssZ.
If the seconds place is not 00, it is automatically set to start of the next minute.
Period Integer No The precision of the retrieved monitoring data:
  • 60 seconds
  • 600 seconds
  • 3600 seconds
The default value is 60 seconds.

Return Parameters

Name Type Description
MonitorData InstanceMonitorDataType A collection composed of instance monitoring data InstanceMonitorDataType.

Error Code

Error Code Description Http status code Meaning
InvalidInstanceId.NotFound The InstanceId provided does not exist in our records. 404 The specified InstanceId does not exist.
MissingParameter The input parameter InstanceId that is mandatory for processing this request is not supplied. 400 InstanceId value missing.
InvalidStartTime.Malformed The specified parameter StartTime is not valid. 400 The indicated StartTime format is invalid.
MissingParameter The input parameter StartTime that is mandatory for processing this request is not supplied. 400 The StartTime value is missing.
InvalidEndTime.Malformed The specified parameter EndTime is not valid. 400 The indicated EndTime format is invalid.
MissingParameter The input parameter EndTime that is mandatory for processing this request is not supplied. 400 The EndTime value is missing.
InvalidParameter The specified parameter Period is not valid. 400 The indicated Period is not a number.
InvalidPeriod.ValueNotSupported The specified parameter Period is not valid. 400 The indicated Period format is invalid.
InvalidStartTime.TooEarly The specified parameter StartTime is earlier than 30 days. 400 The indicated StartTime is too early.

Examples

Request Example

  1. https://ecs.aliyuncs.com/?Action=DescribeInstanceMonitorData
  2. &InstanceId=i-instnace1
  3. &StartTime=2014-10-29T23:00:00Z
  4. &EndTime=2014-10-30T08:00:00Z
  5. &<Public Request Parameters>

Return Example

XML format

  1. <DescribeInstanceMonitorDataResponse>
  2. <RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
  3. <MonitorData>
  4. <InstanceMonitorData>
  5. <InstanceId>Bc0102-23xYm09</InstanceId>
  6. <CPU>2</CPU>
  7. <IntranetRX>122</IntranetRX>
  8. <IntranetTX>343</IntranetTX>
  9. <IntranetFlow>675</IntranetFlow>
  10. <IntranetBandwidth>10</IntranetBandwidth>
  11. <InternetRX>122</InternetRX>
  12. <InternetTX>343</InternetTX>
  13. <InternetFlow>675</InternetFlow>
  14. <InternetBandwidth>10</InternetBandwidth>
  15. <IOPSRead>1000</IOPSRead>
  16. <IOPSWrite>200</IOPSWrite>
  17. <BPSRead>1000</BPSRead>
  18. <BPSWrite>200</BPSWrite>
  19. <TimeStamp>2010-01-21T09:50:23Z</TimeStamp>
  20. </InstanceMonitorData>
  21. </MonitorData>
  22. </DescribeInstanceMonitorDataResponse>

JSON format

  1. {
  2. "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
  3. "MonitorData": {
  4. "InstanceMonitorData": [{
  5. "InstanceId": "Bc0102-23xYm09",
  6. "CPU": 0,
  7. "IntranetRX": 122,
  8. "IntranetTX": 343,
  9. "IntranetFlow": 675,
  10. "IntranetBandwidth": 10,
  11. "InternetRX": 122,
  12. "InternetTX": 343,
  13. "InternetFlow": 675,
  14. "InternetBandwidth": 10,
  15. "IOPSRead": 1000,
  16. "IOPSWrite": 200,
  17. "BPSRead": 1000,
  18. "BPSWrite": 200,
  19. "TimeStamp": "2010-01-21T09:50:23Z"
  20. }]
  21. }
  22. }
Thank you! We've received your feedback.