查询云服务器规格变更支持列表-九游平台
功能介绍
变更规格时,部分规格的云服务器之间不能互相变更。您可以通过本接口,通过指定弹性云服务器规格,查询该规格可以变更的规格列表。
调试
您可以在中调试该接口。
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所示。
参数 |
参数类型 |
描述 |
---|---|---|
flavors |
array of objects |
云服务器规格列表。 详情请参见表4。 |
参数 |
参数类型 |
描述 |
---|---|---|
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 |
云服务器规格的扩展字段。 详情请参见。 |
instance_quota |
object |
预留属性。 |
参数 |
参数类型 |
描述 |
---|---|---|
rel |
string |
快捷链接标记名称。 |
href |
string |
对应快捷链接。 |
type |
string |
快捷链接类型,当前接口未使用,缺省值为null。 |
请求示例
查询云服务器规格“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.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2", "type": null }, { "rel": "bookmark", "href": "https://ecs.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" } } ] }
返回值
请参考通用请求返回值。
错误码
请参考。
相关文档
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨