更新时间:2025-07-09 GMT+08:00
分享

查询指定镜像实例

功能介绍

查询指定的镜像实例当前这个接口的查询数据和list查询的一致。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v1/{project_id}/image-servers/{server_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目唯一标识。

server_id

String

镜像实例唯一标识。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

id

String

实例的唯一标识。

name

String

镜像实例名称。

description

String

描述。

image_ref

ImageRef object

镜像源信息。

server_group_id

String

APS服务器组ID。

app_group_id

String

应用组ID。

server_id

String

APS实例ID。

instance_id

String

ECS服务器ID。

image_id

String

镜像产物唯一标识。

status

String

镜像实例的状态:

  • 'CREATING' - 实例创建中

  • 'ACTIVE' - 实例正常运行

  • 'BUILDING' - 镜像创建中

  • 'BUILT' - 镜像任务结束

  • 'ERROR' - 实例处于异常

  • 'DELETING' - 实例删除中

  • 'NULL' - 未设置

authorize_accounts

Array of ImageAccountInfo objects

应用组授权用户,

  • 限制用户类型:'USER' - 用户

create_time

DateTime

镜像实例创建时间。

update_time

DateTime

更新时间。

enterprise_project_id

String

企业项目ID,仅企业项目需配置(字段为空或者0表示使用默认default企业项目)。

表4 ImageRef

参数

参数类型

描述

id

String

镜像源的唯一标识。

image_type

String

镜像源的镜像类型:

  • gold - 云市场镜像

  • public - 公共镜像

  • private - 私有镜像

  • shared - 共享镜像

  • other - 其他

spce_code

String

镜像源的规格编码,对于gold镜像类型,这个值是的必须项。

product_id

String

镜像源的产品ID,对于gold镜像类型,这个值是的必须项。

表5 ImageAccountInfo

参数

参数类型

描述

account

String

用户(组)。

account_type

String

用户类型:

  • USER - 用户

  • USER_GROUP - 用户组

domain

String

域名城。

状态码:400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:403

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:404

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:405

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:500

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

状态码:503

表12 响应Body参数

参数

参数类型

描述

error_code

String

错误码,失败时返回。

error_msg

String

错误描述。

请求示例

响应示例

状态码:200

成功响应。

{
  "id" : "222xx-xxxsdfsadf-xxx",
  "name" : "测试镜像实例",
  "description" : "测试镜像实例。",
  "image_ref" : {
    "id" : "1",
    "image_type" : "private",
    "spce_code" : "78b3e72878a81a9b3bfd2b3c912c0f58",
    "product_id" : "00301-1238008-0--0"
  },
  "server_group_id" : "xxx-xxx-xxx-xx",
  "app_group_id" : "xxx-xxx-xxx-xx",
  "server_id" : "xxx-xxx-xxx-xx",
  "instance_id" : "cc5279d6-xxxx-xx-xxx-b87a97cf02af",
  "image_id" : "xxx-xxx-xxx-xx",
  "status" : "BUILDING",
  "authorize_accounts" : [ {
    "account" : "zhangsan***@test.com",
    "account_type" : "USER_GROUP",
    "domain" : "siv.***.huawei.com"
  } ],
  "create_time" : "2022-03-07T10:40:43.858Z",
  "update_time" : "2022-03-07T10:40:43.858Z",
  "enterprise_project_id" : "xxx-xxx-xx-x-x-xx"
}

状态码

状态码

描述

200

成功响应。

400

由于包含语法错误,当前请求无法被服务器理解。

401

鉴权失败。

403

没有操作权限。

404

找不到资源。

405

请求中指定的方法不被允许。

500

服务内部错误,具体返回错误码请参见错误码说明。

503

服务不可用。

错误码

请参见错误码

相关文档