閱讀491 返回首頁    go 阿裏雲 go 技術社區[雲棲]


查看雲服務器實例的監控信息__監控相關接口_API 參考_雲服務器 ECS-阿裏雲

描述

分頁查詢本用戶的所有雲服務器相關的監控信息。

  • 隻能查詢到狀態非 Deleted 或者非剛剛創建完成尚處於 Stopped 狀態的雲服務器的監控信息。
  • 可返回的監控內容包括:雲服務器的 CPU 使用率、雲服務器分配到的內存數、雲服務器接收到的數據流量、雲服務器發送的數據流量、雲服務器網絡流量、雲服務器平均帶寬。有可能返回的監控內容中會缺少部分內部,這可能是由於係統沒有獲得到相應的信息,比如當時實例處於 Stopped 狀態。
  • 一次最大隻容許返回 400 條監控數據,如果指定的(EndTime – StartTime)/ Peroid > 400,則返回錯誤。

請求參數

名稱 類型 是否必須 描述
Action String 係統規定參數,取值:DescribeInstanceMonitorData
InstanceId String 指定監控的實例 ID
StartTime String 獲取數據的起始時間點:按照 ISO8601 標準表示,並需要使用 UTC 時間。格式為:YYYY-MM-DDThh:mm:ssZ。
如果秒不是 00,則自動取為下一分鍾開始時
EndTime String 獲取數據的結束時間點:按照 ISO8601 標準表示,並需要使用 UTC 時間。格式為:YYYY-MM-DDThh:mm:ssZ。
如果秒不是 00,則自動取為下一分鍾開始時
Period Integer 獲取監控數據的精度:
  • 60 秒
  • 600 秒
  • 3600 秒
默認 60 秒。

返回參數

名稱 類型 描述
MonitorData InstanceMonitorDataType 實例的監控數據 InstanceMonitorDataType 組成的集合。

錯誤碼

錯誤代碼 描述 Http 狀態碼 語義
InvalidInstanceId.NotFound The InstanceId provided does not exist in our records. 404 指定的 InstanceId 不存在
MissingParameter The input parameter "InstanceId" that is mandatory for processing this request is not supplied. 400 缺少 InstanceId 值
InvalidStartTime.Malformed The specified parameter "StartTime" is not valid. 400 指定的 StartTime 格式不合法
MissingParameter The input parameter "StartTime" that is mandatory for processing this request is not supplied. 400 缺少 StartTime 值
InvalidEndTime.Malformed The specified parameter "EndTime" is not valid. 400 指定的 EndTime 格式不合法
MissingParameter The input parameter "EndTime" that is mandatory for processing this request is not supplied. 400 缺少 EndTime 值
InvalidParameter The specified parameter "Period" is not valid. 400 指定的 Period 不是數字
InvalidPeriod.ValueNotSupported The specified parameter "Period" is not valid. 400 指定的 Period 格式不合法
InvalidStartTime.TooEarly The specified parameter "StartTime" is too early. 400 指定的 StartTime 太早

示例

請求示例

https://ecs.aliyuncs.com/?Action=DescribeInstanceMonitorData
&InstanceId=i-instnace1
&StartTime=2014-10-29T23:00:00Z
&EndTime=2014-10-30T08:00:00Z
&<公共請求參數>

返回示例

XML格式

<DescribeInstanceMonitorDataResponse>
    <RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
    <MonitorData>
        <InstanceMonitorData>
            <InstanceId>Bc0102-23xYm09</InstanceId>
            <CPU>2</CPU>
            <IntranetRX>122</IntranetRX>
            <IntranetTX>343</IntranetTX>
            <IntranetFlow>675</IntranetFlow>
            <IntranetBandwidth>10</IntranetBandwidth>
            <InternetRX>122</InternetRX>
            <InternetTX>343</InternetTX>
            <InternetFlow>675</InternetFlow>
            <InternetBandwidth>10</InternetBandwidth>
            <IOPSRead>1000</IOPSRead>
            <IOPSWrite>200</IOPSWrite>
            <BPSRead>1000</BPSRead>
            <BPSWrite>200</BPSWrite>
            <TimeStamp>2010-01-21T09:50:23Z</TimeStamp>
        </InstanceMonitorData>
    </MonitorData>
</DescribeInstanceMonitorDataResponse>

JSON格式

{
    "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
    "MonitorData": {
        "InstanceMonitorData": [{
            "InstanceId": "Bc0102-23xYm09",
            "CPU": 0,
            "IntranetRX": 122,
            "IntranetTX": 343,
            "IntranetFlow": 675,
            "IntranetBandwidth": 10,
            "InternetRX": 122,
            "InternetTX": 343,
            "InternetFlow": 675,
            "InternetBandwidth": 10,
            "IOPSRead": 1000,
            "IOPSWrite": 200,
            "BPSRead": 1000,
            "BPSWrite": 200,
            "TimeStamp": "2010-01-21T09:50:23Z"
        }]
    }
}

最後更新:2016-11-23 16:03:51

  上一篇:go 查詢可用區__地域相關接口_API 參考_雲服務器 ECS-阿裏雲
  下一篇:go 查看彈性公網IP監控信息__監控相關接口_API 參考_雲服務器 ECS-阿裏雲