
# 查询云服务器规格变更支持列表（废弃）
#### 功能介绍
变更规格时，部分规格的云服务器之间不能互相变更。您可以通过本接口，通过指定弹性云服务器规格，查询该规格可以变更的规格列表。
当前API已废弃，请使用[查询云服务器规格变更支持列表 - ListResizeFlavors](https://support.huaweicloud.com/api-ecs/ecs_02_0402.html)。
#### URI
GET /v2.1/{project_id}/resize_flavors?instance_uuid={instance_uuid}\&source_flavor_id={source_flavor_id}\&source_flavor_name={source_flavor_name}\&sort_key={sort_key}\&sort_dir={sort_dir}\&limit={limit}\&marker={marker}
参数说明请参见[表1]。
 表1路径参数 
| 参数         | 是否必选 | 描述                                                                                                                         |
|:---|:---|:---|
| project_id | 是    | 项目ID。 获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-ecs/ecs_01_0016.html)。 |
   
![](https://support.huaweicloud.com/api-ecs/public_sys-resources/note_3.0-zh-cn.png)
instance_uuid、source_flavor_id、source_flavor_name三个参数必须要选择一个参数使用。如果同时选择传递多个参数，则系统默认按照instance_uuid、source_flavor_id、source_flavor_name的优先级进行处理。
查询参数如[表2]所示。
 表2查询参数 
| 参数                 | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| instance_uuid      | 否    | String  | 进行规格切换的云服务器ID，UUID格式。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| source_flavor_id   | 否    | String  | 进行规格切换的云服务器源规格ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| source_flavor_name | 否    | String  | 进行规格切换的云服务器源规格名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| sort_key           | 否    | String  | 排序字段。 key的取值范围： - flavorid：表示规格ID。sort_key的默认值为"flavorid"。  - name：表示规格名称。  - memory_mb：表示内存大小。  - vcpus：表示CPU大小。  - root_gb：表示系统盘大小。   |
| sort_dir           | 否    | String  | 升序/降序排序，默认值为：asc。 取值范围： - asc：表示升序。  - desc：表示降序。                                                                                                                                                                                                                                                                                                                                                                                             |
| limit              | 否    | Integer | 单页面可显示的flavor条数最大值，默认是1000。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| marker             | 否    | String  | 以单页最后一条flavor的ID作为分页标记。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   
#### 请求消息
无
#### 响应消息
响应参数如[表3]所示。
 表3响应参数 
| 参数      | 是否必选 | 参数类型             | 描述                                                                                                                 |
|:---|:---|:---|:---|
| flavors | 是    | Array of objects | 云服务器规格列表。 详情请参见[表4]。 |
   
 表4flavors数据结构说明 
| 参数                         | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| id                         | 是    | String           | 云服务器规格ID。                                                                                                                                                                                                                                                                                                                                                                                          |
| name                       | 是    | String           | 云服务器规格名称。                                                                                                                                                                                                                                                                                                                                                                                          |
| vcpus                      | 是    | Integer          | 云服务器规格对应要求的CPU核数。                                                                                                                                                                                                                                                                                                                                                                                  |
| ram                        | 是    | Integer          | 云服务器规格对应要求的内存大小，单位为MiB。                                                                                                                                                                                                                                                                                                                                                                            |
| disk                       | 是    | Integer          | 云服务器规格对应要求的系统盘大小。 当前未使用该参数，缺省值为0。                                                                                                                                                                                                                                                                                                                 |
| swap                       | 否    | String           | 云服务器规格对应要求的交换分区大小。 当前未使用该参数，缺省值为""。                                                                                                                                                                                                                                                                                                                 |
| OS-FLV-EXT-DATA:ephemeral  | 是    | Integer          | 扩展属性，临时盘大小。 当前未使用该参数，缺省值为0。                                                                                                                                                                                                                                                                                                                           |
| OS-FLV-DISABLED:disabled   | 是    | Boolean          | 扩展属性，指定规格是否可用。 - true：不可用  - false：可用   说明： 当前未使用该参数。 |
| rxtx_factor                | 是    | Float            | 扩展属性。 说明： 当前未使用该参数。                                                                                                                                                                                                                                                                                  |
| rxtx_quota                 | 是    | String           | 云服务器可使用网络带宽的软限制。 当前未使用该参数，缺省值为null。                                                                                                                                                                                                                                                                                                                 |
| rxtx_cap                   | 是    | String           | 云服务器可使用网络带宽的硬限制。 当前未使用该参数，缺省值为null。                                                                                                                                                                                                                                                                                                                   |
| os-flavor-access:is_public | 是    | Boolean          | 扩展属性，flavor是否给所有租户使用。 - true：表示给所有租户使用。  - false：表示给指定租户使用。   缺省值为"true"。                               |
| links                      | 是    | Array of objects | 规格相关快捷链接地址。 详情请参见[表5]。                                                                                                                                                                                                                                                                           |
| extra_specs                | 是    | Array of objects | 云服务器规格的扩展字段。 详情请参见[表6](https://support.huaweicloud.com/api-ecs/zh-cn_topic_0020212656.html#ZH-CN_TOPIC_0020212656__table59078165)。                                                                                                                                                                                                                  |
   
 表5links字段数据结构说明 
| 参数   | 是否必选 | 参数类型   | 描述                       |
|:---|:---|:---|:---|
| rel  | 是    | String | 快捷链接标记名称。                |
| href | 是    | String | 对应快捷链接。                  |
| type | 是    | String | 快捷链接类型，当前接口未使用，缺省值为null。 |
   
#### 请求示例
```
GET https://{endpoint}/v1/{project_id}/cloudservers/resize_flavors?source_flavor_id=c3.xlarge.2
```
#### 响应示例
```
{
    "flavors": [
        {
            "id": "c3.15xlarge.2",
            "name": "c3.15xlarge.2",
            "vcpus": "60",
            "ram": 131072,
            "disk": "0",
            "swap": "",
            "links": [
                {
                    "rel": "self",
                    "href": "https://compute-ext.region.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
                    "type": null
                },
                {
                    "rel": "bookmark",
                    "href": "https://compute-ext.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
                    "type": null
                }
            ],
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "rxtx_factor": 1,
            "OS-FLV-DISABLED:disabled": false,
            "rxtx_quota": null,
            "rxtx_cap": null,
            "os-flavor-access:is_public": true,
            "extra_specs": {
                "ecs:virtualization_env_types": "CloudCompute",
                "ecs:generation": "c3",
                "ecs:performancetype": "computingv3",
                "resource_type": "IOoptimizedC3_2"
             }
        }
    ]
}
```
#### 返回值
请参考[通用请求返回值](https://support.huaweicloud.com/api-ecs/ecs_07_0001.html)。
#### 错误码
请参考[错误码](https://support.huaweicloud.com/api-ecs/ecs_07_0002.html)。
