
# CLI命令参考
#### 镜像任务
| API名称    | 命令                         | 描述                     | 操作                                                                                       |
|:---|:---|:---|:---|
| 异步任务进度查询 | hcloud IMS ShowJobProgress | 该接口为扩展接口，主要用于查询异步任务进度。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ShowJobProgress) |
   
#### 镜像
| API名称             | 命令                                    | 描述                                                                                                                                                                                                                                                                                                                                                            | 操作                                                                                                  |
|:---|:---|:---|:---|
| 导出镜像              | hcloud IMS ExportImage                | 该接口为扩展接口，用于用户将自己的私有镜像导出到指定的OBS桶中。                                                                                                                                                                                                                                                                                                                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ExportImage)                |
| 导出镜像（新）           | hcloud IMS ExportImageInSafeMode      | 该接口为扩展接口，用于用户将自己的私有镜像导出到指定的OBS桶中。                                                                                                                                                                                                                                                                                                                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ExportImageInSafeMode)      |
| 查询镜像列表            | hcloud IMS ListImages                 | 根据不同条件查询镜像列表信息。                                                                                                                                                                                                                                                                                                                                               | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListImages)                 |
| 更新镜像信息            | hcloud IMS UpdateImage                | 更新镜像信息接口，主要用于镜像属性的修改。当前仅支持可用（active）状态的镜像更新相关信息。                                                                                                                                                                                                                                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=UpdateImage)                |
| 使用外部镜像文件制作数据镜像    | hcloud IMS CreateDataImage            | 使用上传至OBS桶中的外部数据卷镜像文件制作数据镜像。作为异步接口，调用成功，只是说明后台收到了制作请求，镜像是否制作成功需要通过异步任务查询接口查询该任务的执行状态。具体请参考[异步任务进度查询](https://support.huaweicloud.com/api-ims/ims_03_0911.html)。                                                                                                                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateDataImage)            |
| 使用外部镜像文件制作数据镜像（新） | hcloud IMS CreateDataImageInSafeMode  | 使用上传至OBS桶中的外部数据卷镜像文件制作数据镜像。作为异步接口，调用成功，只是说明后台收到了制作请求，镜像是否制作成功需要通过异步任务查询接口查询该任务的执行状态。具体请参考[异步任务进度查询](https://support.huaweicloud.com/api-ims/ims_03_0911.html)。                                                                                                                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateDataImageInSafeMode)  |
| 制作镜像              | hcloud IMS CreateImage                | 本接口用于制作私有镜像，支持： - 使用云服务器制作私有镜像（系统盘镜像/数据盘镜像）。  - 使用上传至OBS桶中的外部镜像文件制作系统盘镜像。  - 使用数据盘制作系统盘镜像。   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateImage)                |
| 制作镜像（新）           | hcloud IMS CreateImageInSafeMode      | 本接口用于制作私有镜像，支持： - 使用云服务器制作私有镜像（系统盘镜像/数据盘镜像）。  - 使用上传至OBS桶中的外部镜像文件制作系统盘镜像。  - 使用数据盘制作系统盘镜像。       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateImageInSafeMode)      |
| 注册镜像              | hcloud IMS RegisterImage              | 该接口用于将镜像文件注册为云平台未初始化的私有镜像。                                                                                                                                                                                                                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=RegisterImage)              |
| 镜像文件快速导入          | hcloud IMS ImportImageQuick           | 使用上传至OBS桶中的超大外部镜像文件制作私有镜像，目前仅支持RAW或ZVHD2格式镜像文件。且要求镜像文件大小不能超过1TB。                                                                                                                                                                                                                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ImportImageQuick)           |
| 镜像文件快速导入（新）       | hcloud IMS ImportImageQuickInSafeMode | 使用上传至OBS桶中的超大外部镜像文件制作私有镜像，目前仅支持RAW或ZVHD2格式镜像文件。且要求镜像文件大小不能超过1TB。                                                                                                                                                                                                                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ImportImageQuickInSafeMode) |
| 制作整机镜像            | hcloud IMS CreateWholeImage           | 使用云服务器或者云服务器备份制作整机镜像。作为异步接口，调用成功，只是说明后台收到了制作整机镜像的请求，镜像是否制作成功需要通过异步任务查询接口查询该任务的执行状态，具体请参考[异步任务进度查询](https://support.huaweicloud.com/api-ims/ims_03_0911.html)。                                                                                                                                                                                                 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateWholeImage)           |
| 查询镜像支持的OS列表       | hcloud IMS ListOsVersions             | 查询当前区域弹性云服务器的OS兼容性列表。                                                                                                                                                                                                                                                                                                                                         | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListOsVersions)             |
   
#### 镜像共享
| API名称      | 命令                            | 描述                                       | 操作                                                                                          |
|:---|:---|:---|:---|
| 批量添加镜像成员   | hcloud IMS BatchAddMembers    | 该接口为扩展接口，主要用于镜像共享时用户将多个镜像共享给多个用户。        | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=BatchAddMembers)    |
| 批量更新镜像成员状态 | hcloud IMS BatchUpdateMembers | 该接口为扩展接口，主要用于用户接受或者拒绝多个共享镜像时批量更新镜像成员的状态。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=BatchUpdateMembers) |
| 批量删除镜像成员   | hcloud IMS BatchDeleteMembers | 该接口为扩展接口，主要用于取消镜像共享。                     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=BatchDeleteMembers) |
| 获取镜像成员详情   | hcloud IMS ShowImageMember    | 该接口主要用于镜像共享中查询某个镜像成员的详情。                 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ShowImageMember)    |
| 获取镜像成员列表   | hcloud IMS ListImageMembers   | 该接口用于共享镜像过程中，获取接受该镜像的成员列表。               | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListImageMembers)   |
   
#### 镜像复制
| API名称          | 命令                                     | 描述                                                                                 | 操作                                                                                                   |
|:---|:---|:---|:---|
| Region内复制镜像    | hcloud IMS CopyImageInRegion           | 该接口为扩展接口，主要用于用户将一个已有镜像复制为另一个镜像。复制镜像时，可以更改镜像的加密等属性，以满足不同的场景。                        | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CopyImageInRegion)           |
| Region内复制镜像（新） | hcloud IMS CopyImageInRegionInSafeMode | 该接口为扩展接口，主要用于用户将一个已有镜像复制为另一个镜像。复制镜像时，可以更改镜像的加密等属性，以满足不同的场景。                        | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CopyImageInRegionInSafeMode) |
| 跨Region复制镜像    | hcloud IMS CopyImageCrossRegion        | 该接口为扩展接口，用户在一个区域制作的私有镜像，可以通过跨Region复制镜像将镜像复制到其他区域，在其他区域发放相同类型的云服务器，帮助用户实现区域间的业务迁移。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CopyImageCrossRegion)        |
   
#### 镜像标签
| API名称         | 命令                              | 描述                                            | 操作                                                                                            |
|:---|:---|:---|:---|
| 按条件查询租户镜像标签列表 | hcloud IMS ListTags             | 根据不同条件查询镜像标签列表信息。                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListTags)             |
| 增加或修改标签       | hcloud IMS CreateOrUpdateTags   | 该接口主要用于为某个镜像增加或修改一个自定义标签。通过自定义标签，用户可以将镜像进行分类。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=CreateOrUpdateTags)   |
| 按标签查询镜像       | hcloud IMS ListImageByTags      | 该接口用于按标签或其他条件对镜像进行过滤或者计数使用。                   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListImageByTags)      |
| 查询租户所有镜像标签    | hcloud IMS ListImagesTags       | 该接口用于查询租户的所有镜像上的标签。                           | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListImagesTags)       |
| 查询镜像标签        | hcloud IMS ListImageTags        | 该接口用于查询指定镜像上的所有标签。                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListImageTags)        |
| 添加镜像标签        | hcloud IMS AddImageTag          | 该接口用于为指定镜像添加或更新指定的单个标签。                       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=AddImageTag)          |
| 批量添加删除镜像标签    | hcloud IMS BatchAddOrDeleteTags | 该接口用于为指定镜像批量添加/更新、删除标签。                       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=BatchAddOrDeleteTags) |
| 删除镜像标签        | hcloud IMS DeleteImageTag       | 该接口用于为镜像删除指定的标签。                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=DeleteImageTag)       |
| 批量删除镜像标签      | hcloud IMS BatchDeleteTags      | 该接口用于为指定镜像批量删除标签。                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=BatchDeleteTags)      |
   
#### 镜像配额
| API名称  | 命令                        | 描述                                    | 操作                                                                                      |
|:---|:---|:---|:---|
| 查询镜像配额 | hcloud IMS ShowImageQuota | 该接口为扩展接口，主要用于查询租户在当前Region的私有镜像的配额数量。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ShowImageQuota) |
   
#### 镜像共享（OpenStack原生）
| API名称                  | 命令                                 | 描述                                      | 操作                                                                                               |
|:---|:---|:---|:---|
| 获取镜像成员列表（OpenStack原生）  | hcloud IMS GlanceListImageMembers  | 该接口用于共享镜像过程中，获取接受该镜像的成员列表。              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceListImageMembers)  |
| 添加镜像成员（OpenStack原生）    | hcloud IMS GlanceAddImageMember    | 用户共享镜像给其他用户时，使用该接口向该镜像成员中添加接受镜像用户的项目ID。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceAddImageMember)    |
| 获取镜像成员详情（OpenStack原生）  | hcloud IMS GlanceShowImageMember   | 该接口主要用于镜像共享中查询某个镜像成员的详情。                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceShowImageMember)   |
| 更新镜像成员状态（OpenStack原生）  | hcloud IMS GlanceUpdateImageMember | 用户接受或者拒绝共享镜像时，使用该接口更新镜像成员的状态。           | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceUpdateImageMember) |
| 删除指定的镜像成员（OpenStack原生） | hcloud IMS GlanceDeleteImageMember | 该接口用于取消对某个用户的镜像共享。                      | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceDeleteImageMember) |
   
#### 镜像标签（OpenStack原生）
| API名称             | 命令                         | 描述                                               | 操作                                                                                       |
|:---|:---|:---|:---|
| 增加标签（OpenStack原生） | hcloud IMS GlanceCreateTag | 该接口主要用于为某个镜像添加一个自定义标签。通过自定义标签，用户可以将镜像进行分类。       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceCreateTag) |
| 删除标签（OpenStack原生） | hcloud IMS GlanceDeleteTag | 该接口主要用于删除某个镜像的自定义标签，通过该接口，用户可以将私有镜像中一些不再使用的标签删除。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceDeleteTag) |
   
#### 镜像视图（OpenStack原生）
| API名称                   | 命令                                      | 描述                                                         | 操作                                                                                                    |
|:---|:---|:---|:---|
| 查询镜像视图（OpenStack原生）     | hcloud IMS GlanceShowImageSchemas       | 该接口主要用于查询镜像视图，通过视图，用户可以了解到镜像包含哪些属性，同时也可以了解每个属性的数据类型等。      | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceShowImageSchemas)       |
| 查询镜像成员列表视图（OpenStack原生） | hcloud IMS GlanceListImageMemberSchemas | 该接口主要用于查询镜像成员列表视图，通过视图，用户可以了解到镜像成员包含哪些属性，同时也可以了解每个属性的数据类型。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceListImageMemberSchemas) |
| 查询镜像列表视图（OpenStack原生）   | hcloud IMS GlanceListImageSchemas       | 该接口主要用于查询镜像列表视图，通过该接口用户可以了解到镜像列表的详细情况和数据结构。                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceListImageSchemas)       |
| 查询镜像成员视图（OpenStack原生）   | hcloud IMS GlanceShowImageMemberSchemas | 该接口主要用于查询镜像成员视图，通过视图，用户可以了解到镜像成员包含哪些属性，同时也可以了解每个属性的数据类型。   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceShowImageMemberSchemas) |
   
#### 镜像（OpenStack原生）
| API名称                | 命令                                   | 描述                                                  | 操作                                                                                                 |
|:---|:---|:---|:---|
| 查询镜像列表（OpenStack原生）  | hcloud IMS GlanceListImages          | 获取镜像列表。                                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceListImages)          |
| 创建镜像元数据（OpenStack原生） | hcloud IMS GlanceCreateImageMetadata | 创建镜像元数据。调用创建镜像元数据接口成功后，只是创建了镜像的元数据，镜像对应的实际镜像文件并不存在。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceCreateImageMetadata) |
| 查询镜像详情（OpenStack原生）  | hcloud IMS GlanceShowImage           | 查询单个镜像详情，用户可以通过该接口查询单个私有或者公共镜像的详情。                  | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceShowImage)           |
| 删除镜像（OpenStack原生）    | hcloud IMS GlanceDeleteImage         | 该接口主要用于删除镜像，用户可以通过该接口将自己的私有镜像删除。                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceDeleteImage)         |
| 更新镜像信息（OpenStack原生）  | hcloud IMS GlanceUpdateImage         | 修改镜像信息。                                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=GlanceUpdateImage)         |
   
#### 查询API版本信息（OpenStack原生）
| API名称               | 命令                      | 描述                               | 操作                                                                                    |
|:---|:---|:---|:---|
| 查询版本列表（OpenStack原生） | hcloud IMS ListVersions | 查询API的版本信息列表，包括API的版本兼容性、域名信息等。  | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ListVersions) |
| 查询版本列表（OpenStack原生） | hcloud IMS ShowVersion  | 查询指定版本API的信息，包括该版本API的兼容性、域名信息等。 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/IMS/cli?api=ShowVersion)  |
   
