查询可重装云主机镜像列表

接口说明

本接口用于查看可重装云主机镜像列表。
● 用户根据云主机ID(serverId)查询可重装的镜像列表。
● 镜像分为用户自定义镜像和公共镜像。


推荐使用API Explorer调试

API Explorer支持接口在线可视化调用,同时自动生成动态代码示例,搭配OpenAPI SDK无需计算签名实现接口快速集成。

URL

GET https://ecloud.10086.cn/api/openapi-ecs/acl/v3/server/{serverId}/rebuild/images

请求参数

Path

参数名称
类型
必填
描述
serverId
string
是

云主机ID,可通过主机列表详情接口获取。

Query

参数名称
类型
必填
描述
type
integer(int32)
是

镜像类型。1:用户自定义镜像; 2:公共镜像。

请求示例

GET https://ecloud.10086.cn/api/openapi-ecs/acl/v3/server/{serverId}/rebuild/images

返回参数

返回码:200
OK
参数名称
类型
描述
body
<可用于重装云主机的镜像返回体> array

请求成功时返回的数据。

createdTime
string(date-time)

创建时间。

id
string

镜像ID。

minDisk
integer(int64)

主机规格需要的系统盘最小大小,单位G。

modifiedTime
string(date-time)

更新时间。

name
string

镜像名称。

note
string

备注。

osType
enum(linux,windows,other)

操作系统类型:linux,windows。

serverId
string

云主机ID。

size
integer(int64)

镜像大小,单位M。

sourceImageId
string

源镜像ID。

sourceImagePoolId
string

原镜像所属资源池ID。

status
enum(unrecognized,active,saving,queued,killed,pending_delete,deleted,caching)

镜像状态。

type
integer(int32)

镜像来源类型。

url
string

镜像路径。

errorCode
string

统一错误码。

errorMessage
string

页面国际化错误提示。

errorParams
<string> array

统一错误码的自定义参数。

requestId
string

每个请求的序列号。

state
enum(OK,ERROR,EXCEPTION,ALARM,FORBIDDEN)

返回状态码。返回正常:OK,返回错误:ERROR,返回异常:EXCEPTION,需要告警实现的:ALARM,禁止访问:FORBIDDEN。

返回示例

返回码:200
OK
{
	"requestId":"reqId-***",
	"state":"OK",
	"body":[
		{
			"id":"id",
			"serverId":null,
			"name":"openEuler 22.03 64位",
			"type":2,
			"url":null,
			"sourceImagePoolId":null,
			"sourceImageId":null,
			"status":"active",
			"size":20480,
			"createdTime":"2023-03-21 16:50:18",
			"modifiedTime":"2024-06-20 16:50:32",
			"note":null,
			"osType":"linux",
			"minDisk":20
		}
	]
}
本文档内容整理自移动云官方帮助中心(查看原文),仅供参考。