
# 对外租户资源查询 - QueryTenantCloudResources
#### 功能
对外租户资源查询。
| SLA项       | 定义              |
|:---|:---|
| 请求成功率      | \>=99.9%        |
| 可用性        | Tair1           |
| 数据一致性      | 最终一致，不一致时长\<1分钟 |
| 吞吐量        | 4000tps         |
| TP50请求时延   | 2ms             |
| TP99.9请求时延 | 5ms             |
   
#### 注意事项
无
#### 调用方法
GET
#### URI
/rest/dataapi/homs/open-api/v2/cloudresource/instancedata/{resource_type}
**路径参数**
| **参数**        | **是否必选** | **类型** | **值域**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | **描述** |
|:---|:---|:---|:---|:---|
| resource_type | 是        | string | - ECS  - EVS  - EIP  - OBS  - BMS  - ELB  - VPN  - DCS  - DMS  - RDS  - GAUSS  - MODEL_ARTS_INF  - MODEL_ARTS_TRAIN  - MODEL_ARTS_MAOS   | 资源类型。  |
   
**查询参数**
| **参数**       | **是否必选** | **类型**  | **值域**  | **描述**      |
|:---|:---|:---|:---|:---|
| begin_time   | 是        | integer | 无       | 开始时间。       |
| end_time     | 是        | integer | 无       | 结束时间。       |
| offset_value | 否        | integer | 无       | 偏移大小：大于等于0。 |
| page_size    | 否        | integer | 0\~1000 | 页大小：大于等于0。  |
   
#### 请求
- **请求header参数**
  
  | **参数**          | **是否必选** | **类型** | **值域** | **说明**                    |
  |:---|:---|:---|:---|:---|
  | X-APIG-Appcode  | 是        | string | 无      | 由SRE分配的AppCode。           |
  | x-auth-token    | 是        | string | 无      | 调用方APIG的IAM认证token。       |
  | x-hcso-domainid | 否        | string | 无      | 接入的租户ID，HCSO场景必填，其他场景不要求。 |
  | x-hcso-appcode  | 是        | string | 无      | 由SRE分配的AppCode。           |
     
  
- **请求body参数**
  无
  
- **请求示例**
  ```
  GET /rest/dataapi/homs/open-api/v2/cloudresource/instancedata/{resource_type} HTTP/1.1 
  Host: example.com 
  Content-Type: application/json 
  Accept: application/json
  X-APIG-Appcode: xxx 
  x-auth-token: xxx 
  x-hcso-domainid：xxx 
  x-hcso-appcode：xxx
  ```
  
 
#### 响应
- **响应参数**
  - 响应状态码200：返回Data对象。Data对象包含如下属性：
    
    | **参数** | **是否必选** | **类型**       | **值域** | **说明** |
    |:---|:---|:---|:---|:---|
    | total  | 是        | int32        | 无      | 数据总数量。 |
    | list   | 是        | List\<Item\> | 无      | 流程对象。  |
       
    Item对象包含如下属性：
    
    | **参数**                  | **是否必选** | **类型** | **值域** | **说明**   |
    |:---|:---|:---|:---|:---|
    | accumulate_factor_name  | 是        | String | 无      | 累加因子名称。  |
    | accumulate_factor_value | 否        | String | 无      | 累加因子值。   |
    | az_code                 | 否        | String | 无      | 可用区域代码。  |
    | begin_time              | 否        | String | 无      | 开始时间。    |
    | bp_info                 | 否        | String | 无      | 业务信息。    |
    | cloud_service_type_code | 是        | String | 无      | 云服务类型代码。 |
    | csb_params              | 否        | String | 无      | csb参数。   |
    | enterprise_project_id   | 否        | String | 无      | 企业项目ID。  |
    | error_msg               | 否        | String | 无      | 错误消息。    |
    | extend_params           | 否        | String | 无      | 扩展参数。    |
    | extend_params2          | 否        | String | 无      | 扩展参数2。   |
    | record_type             | 否        | String | 无      | 记录类型。    |
    | region_code             | 是        | String | 无      | 区域代码。    |
    | relate_parent_resource  | 否        | String | 无      | 关联父资源。   |
    | relate_root_resource    | 否        | String | 无      | 关联根资源。   |
    | resource_id             | 是        | String | 无      | 资源ID。    |
    | resource_spec_code      | 否        | String | 无      | 资源规格代码。  |
    | resource_type_code      | 否        | String | 无      | 资源类型代码。  |
    | site_code               | 否        | String | 无      | 站点代码。    |
    | tag                     | 否        | String | 无      | 标签。      |
    | time_stamp              | 是        | String | 无      | 时间戳。     |
       
    
   
- **响应示例**
  ```
  HTTP/1.1 200 OK
  Date:Tue,18 Jul 2023 09:58:01 GMT
  Server: example.com
  Content-Type: application/json;charset=UTF8
  {
      "list": [
               {
               "accumulate_factor_name": "累加因子名称",
               "accumulate_factor_value": "累加因子值",
               "az_code": "可用区域代码",
               "begin_time": "开始时间",
               "bp_info": "业务信息",
               "cloud_service_type_code": "云服务类型代码",
               "csb_params": "csb参数",
               "enterprise_project_id": "企业项目ID",
               "error_msg": "错误消息",
               "extend_params": "扩展参数",
               "extend_params2": "扩展参数2",
               "record_type": "记录类型",
               "region_code": "区域代码",
               "relate_parent_resource": "关联父资源",
               "relate_root_resource": "关联根资源",
               "resource_id": "资源ID",
               "resource_spec_code": "资源规格代码",
               "resource_type_code": "资源类型代码",
               "site_code": "站点代码",
               "tag": "标签",
               "time_stamp": "时间戳"
                }
              ],
              "total": "总数"
  }
  ```
  
 
#### 状态码
| **状态码** | **说明**     |
|:---|:---|
| 200     | 操作成功。      |
| 400     | 参数错误。      |
| 401     | token鉴权失败。 |
| 403     | 鉴权失败。      |
| 404     | 接口没找到。     |
   
#### 操作危险级别
Minor
