# 获取资源看图属性列表 - QueryMetricDataSummary

## 简介

获取资源看图属性列表





## 定义

### 公共参数

| 参数名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Action**     | string  | 对应的 API 指令名称，当前 API 为 `QueryMetricDataSummary`                        | **Yes** |
| **PublicKey**  | string  | 用户公钥，可从 [控制台](https://console.zosoc.com/uaccount/api_manage) 获取                                             | **Yes** |
| **Signature**  | string  | 根据公钥及 API 指令生成的用户签名，参见 [签名算法](/docs/api/summary/signature.md)  | **Yes** |

### 请求参数

| 参数名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Region** | string | 参见 [地域和可用区列表](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | 项目ID。不填写为默认项目，子帐号必须填写。 请参考[GetProjectList接口](/docs/api/summary/get_project_list) |**Yes**|
| **ProductKey** | string | 产品唯一标识，参见 [产品概览](https://docs.ucloud.cn/cloudwatch/metric/intro) |**Yes**|
| **Offset** | int | 跳过的数量 |**Yes**|
| **Limit** | int | 当前页数据尺寸 |**Yes**|
| **Metrics.N** | string | 指定要查询的指标列表，不指定则使用默认的指标集合 |No|
| **ResourceIds.N** | string | 指定要查询的资源ID列表 |No|

### 响应字段

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **RetCode** | int | 返回状态码，为 0 则为成功返回，非 0 为失败 |**Yes**|
| **Action** | string | 操作指令名称 |**Yes**|
| **Message** | string | 返回错误消息，当 `RetCode` 非 0 时提供详细的描述信息 |No|
| **TraceId** | string | 链路id |No|
| **TotalCount** | int | 总数 |No|
| **Data** | [*QueryMetricDataSummaryRespData*](#QueryMetricDataSummaryRespData) | 数据 |No|

#### 数据模型


#### QueryMetricDataSummaryRespData

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Total** | int | 总数 |No|
| **List** | array[[*ResourceSummary*](#ResourceSummary)] | 结果集 |No|

#### ResourceSummary

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Region** | string | 地域 |No|
| **Zone** | string | 可用区 |No|
| **ProjectId** | int | 项目id |No|
| **CompanyId** | int | 公司id |No|
| **ResourceId** | string | 资源id |No|
| **Name** | string | 资源名称 |No|
| **RegionCN** | string | 地域中文名 |No|
| **ZoneCN** | string | 可用区中文 |No|
| **ProductKey** | string | 产品类型 |No|
| **OrganizationId** | int | 项目id |No|
| **Status** | int | 资源状态 |No|
| **MonitorAttr** | array[[*ResourceMonitorItem*](#ResourceMonitorItem)] | 资源的各项指标当前值，类型为：<br />map[string][]MetricSingleSample<br />map的key为指标名，value为样本点数组。 |No|

#### ResourceMonitorItem

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Metric** | string | 指标名 |No|
| **MetricValues** | array[[*MetricSingleSample*](#MetricSingleSample)] | 指标数据数组 |No|

#### MetricSingleSample

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Metric** | string | 指标名 |No|
| **Tags** | object | 指标的tag的k-v对象 |No|
| **Value** | [*MetricSample*](#MetricSample) | 指标单个样本点对象 |No|

#### MetricSample

| 字段名 | 类型 | 描述信息 | 必填 |
|:---|:---|:---|:---|
| **Timestamp** | int | 时间戳 |No|
| **Value** | float | 样本值 |No|

## 示例

### 请求示例
    
```
https://api.zosoc.com/?Action=QueryMetricDataSummary
&Region=cn-zj
&ProjectId=CXUBJRIx
&ProductKey=jRIQzjck
&Offset=9
&Limit=3
&Metrics.N=mZHSOGcV
&ResourceIds.N=gYnDoDyh
```

### 响应示例
    
```json
{
  "Action": "QueryMetricDataSummaryResponse",
  "Data": {
    "List": [
      {
        "CompanyId": 11,
        "MonitorAttr": {
          "cloudwatch_loadavg5m": [],
          "cloudwatch_memory_actualused_space": [],
          "uhost_cpu_used": [
            {
              "Metric": "uhost_cpu_used",
              "Tags": {},
              "Value": {
                "Timestamp": 1755597442,
                "Value": 3
              }
            }
          ],
          "uhost_disk_read": [
            {
              "Metric": "uhost_disk_read",
              "Tags": {},
              "Value": {
                "Timestamp": 1755597442,
                "Value": 546
              }
            }
          ],
          "uhost_net_in_flow": [
            {
              "Metric": "uhost_net_in_flow",
              "Tags": {},
              "Value": {
                "Timestamp": 1755597442,
                "Value": 13494
              }
            }
          ]
        },
        "Name": "测试主机",
        "OrganizationId": 33,
        "ProductKey": "uhost",
        "ProjectId": 22,
        "Region": "cn-wlcb",
        "RegionCN": "乌兰察布",
        "ResourceAttr": {},
        "ResourceExtendAttr": {
          "name": "测试主机",
          "private_ip": "127.0.0.1",
          "remark": "ttt",
          "secondary_ip": "",
          "tag": "Default",
          "user_id": "151238458"
        },
        "ResourceId": "uhost-xxx",
        "Status": 0,
        "Zone": "cn-wlcb-01",
        "ZoneCN": "乌兰察布可用区A"
      }
    ],
    "Total": 1
  },
  "RetCode": 0,
  "TotalCount": 1,
  "TraceId": "4f6b2a4a-fdfb-4e87-aa38-38dd71248c09"
}
```





