查询云服务器规格变更支持列表
功能介绍
变更规格时,部分规格的云服务器之间不能互相变更。您可以通过本接口,通过指定弹性云服务器规格,查询该规格可以变更的规格列表。
URI
GET /v1/{project_id}/cloudservers/resize_flavors?instance_uuid={instance_uuid}&source_flavor_id={source_flavor_id}&source_flavor_name={source_flavor_name}
instance_uuid、source_flavor_id、source_flavor_name三个参数必须要选择一个参数使用。如果同时选择传递多个参数,则系统默认按照instance_uuid、source_flavor_id、source_flavor_name的优先级进行处理。
当指定参数instance_uuid查询可切换规格列表时,由于镜像与规格之间有依赖关系,如果虚拟机使用公共镜像创建,接口内部会根据虚拟机所用镜像的标签对规格列表进行过滤,仅返回支持该镜像的规格列表。
查询参数如表2所示。
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
instance_uuid |
否 |
String |
进行规格切换的云服务器ID,UUID格式。 |
|
source_flavor_id |
否 |
String |
进行规格切换的云服务器源规格ID。 |
|
source_flavor_name |
否 |
String |
进行规格切换的云服务器源规格名称。 |
|
sort_key |
否 |
String |
排序字段。默认值为“flavorid”。 key的取值范围:
|
|
sort_dir |
否 |
String |
升序/降序排序,默认值为:asc。 取值范围:
|
|
limit |
否 |
Integer |
单页面可显示的flavor条数最大值,默认是1000。 |
|
marker |
否 |
String |
以单页最后一条flavor的ID作为分页标记。 |
请求消息
无
响应消息
响应参数如表3所示。
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
String |
云服务器规格ID。 |
|
name |
String |
云服务器规格名称。 |
|
vcpus |
String |
云服务器规格对应的CPU核数。 |
|
ram |
Integer |
云服务器规格对应的内存大小,单位为MB。 |
|
disk |
String |
云服务器规格对应的系统盘大小。 当前未使用该参数,缺省值为0。 |
|
swap |
String |
云服务器规格对应要求的交换分区大小。 当前未使用该参数,缺省值为""。 |
|
OS-FLV-EXT-DATA:ephemeral |
Integer |
扩展属性,临时盘大小。 当前未使用该参数,缺省值为0。 |
|
OS-FLV-DISABLED:disabled |
Boolean |
扩展属性,该云服务器规格是否禁用。 当前未使用该参数,缺省值为false。 |
|
rxtx_factor |
Float |
云服务器可使用网络带宽与网络硬件带宽的比例。 当前未使用该参数,缺省值为1。 |
|
rxtx_quota |
String |
云服务器可使用网络带宽的软限制。 当前未使用该参数,缺省值为null。 |
|
rxtx_cap |
String |
云服务器可使用网络带宽的硬限制。 当前未使用该参数,缺省值为null。 |
|
os-flavor-access:is_public |
Boolean |
扩展属性,flavor是否给所有租户使用。
缺省值为true。 |
|
links |
Array of objects |
规格相关快捷链接地址。 详情请参见表5。 |
|
extra_specs |
Object |
云服务器规格的扩展字段。 详情请参见表6。 |
|
instance_quota |
Object |
预留属性。 |
请求示例
查询云服务器规格“c3.xlarge.2”支持变更的规格列表。
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://ecs.region.xxx.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
"type": null
},
{
"rel": "bookmark",
"href": "https://ecs.region.xxx.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"
}
}
]
}
返回值
请参考通用请求返回值。
错误码
请参考错误码。