全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

更换或者重新安装实例操作系统

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:ModifyInstanceImage。
Version String
公共参数,本接口取值:2016-03-04。
InstanceId String

待更换或者重新安装操作系统的实例ID 标准UUID格式,形如^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

示例值:98284100-f6d1-4bbf-886a-1b0765024738
ImageId String

待更换的镜像ID;如果缺省,表明无需改变镜像,只需重新安装实例的操作系统。 标准UUID格式,形如^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

示例值:8f12ad9e-ae9a-44b9-95f3-c4e65ce582e2
SystemDisk.DiskSize Int

云主机系统盘配置参数。若不指定该参数,则按照系统默认值进行分配。通用型N2、N3主机支持更换操作系统时指定系统盘大小。

示例值:-
InstancePassword String

实例开机密码
最短8字符,最长32字符,必须包含大小写英文字符和数字,支持其他可见字符

示例值:1qaQ!abc
KeyId.N String

密钥ID

示例值:552a0523-b9b4-4868-b8d9-52ad7a38bf89
KeepImageLogin Boolean

保留镜像设置登录。该参数只对使用自定义镜像有效。当该值填写为true,默认InstancePassword参数无效。该参数与InstancePassword必须填写一个。 true/false,默认false

示例值:true
SystemDisk.DiskType String

不能给默认值,不传默认按价格体系配置systemDisk属性中第一个创建

SystemDisk.ResizeType String

扩容 offline 离线扩容| online 在线扩容

UserData String

用户自定义数据,必须是base64编码

返回参数

参数名称
类型
描述
RequestId String

请求ID

示例值:-
Return Boolean

更换或者重装实例操作系统成功与否

示例值:true(成功)/false(失败)

请求示例

curl -X GET|POST
'http://kec.api.ksyun.com/?Action=ModifyInstanceImage&Version=2016-03-04'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kec.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'InstanceId=xxx&ImageId=xxx&SystemDisk.DiskSize=xxx&InstancePassword=xxx&KeyId.N=xxx&KeepImageLogin=xxx&SystemDisk.DiskType=xxx&SystemDisk.ResizeType=xxx&UserData=xxx'

返回示例

JSON格式

{
"RequestId":"7a6fa859-85e6-40ba-95d2-69deb5e43b6a",
"Return":true
}

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
InstanceNotFound暂无400暂无
ProductSellOutInvalidproduct already sell out.400此商品在该机房已售罄.
ImageTypeMismatchingForeign region image type mismatching400海外机房镜像类型不同不支持重装
GoSDKVersionInvalidYour GoSDK Version is deprecated for ModifyInstanceImage action, please upgrade your GoSDK to 0.1.29 or Terraform to Version 1.3.26 or later.400您的GoSDK版本过低,请升级GoSDK版本到0.1.29 或者升级Terraform版本到1.3.26
ImageTypeNotSupportedKeyLoginThe ImageType for this not supported KeyLogin400该镜像类型不支持密钥登录
OperationDenied.SpotInstanceThe operation is not permitted due to charge type of the instance.400竞价实例计费方式不允许该操作.
LocalImageOnlySupportSSD3ForModifyImageOnly support instances which the system disk is SSD3.0 using local mirroring to reinstall the system.400仅支持系统盘为ssd3.0的实例使用本地镜像重装系统
RootDiskGbInvalidParameterValueAn invalid or out-of-range value was supplied for the "RootDiskGb" parameter.400“系统卷容量”参数的取值无效或者超出有效范围
ImageIdInvalidParameterValueAn invalid or out-of-range value was supplied for the "ImageId" parameter.400“镜像ID”参数的取值无效或者超出有效范围
InternalError暂无400暂无
ImageHaveInvalidZoneThe specified local mirror is not in the zone.400指定的镜像不在此区域内
SubOrderBindedInstancesubOrder already bound instance400子订单已经绑定实例
InstanceStateNotSupportedThe InstanceState for this action should be "Stopped"400本操作执行时“实例状态”应该是“关闭”
AssembledImageNotSupportReinstallSystemYou cannot reinstall the system by using an image that contains a data disk snapshot.400重装系统不支持包含数据盘快照的镜像
KeyIdInvalidParameterValueAn invalid or out-of-range value was supplied for the "KeyId" parameter.400“KEYID”参数的取值无效或者超出有效范围
Payment.OrderNotFoundorder not found400实例对应的订单不存在
InstanceStateNotSupportedMigrateThe current status of the resource does not support this operation.400本操作执行时“实例状态”不支持
HostNameInvalidParameterValueAn invalid or out-of-range value was supplied for the "HostName" parameter.400“主机操作系统名称”参数的取值无效或者超出有效范围
LocalVolumeRollBackImageTypeMismatchingSystem disk snapshot does not support rollback across operating system versions.400系统盘快照不支持跨操作系统版本回滚.
InvalidParameter.InstanceKeyLimitExceededInvalidParameter.InstanceKeyLimitExceeded400每台云服务器最多10个密钥对
RockyLinuxOnlySupport2048ForRsaKeyThe specified image only support RSA 2048 bit key pair.400该镜像类型仅支持RSA 2048位的密钥
ServiceUnavailable{"RequestId":"7f30b545-dc1b-40dc-9b76-eeca28393989002","Error":{"Code":"ServiceUnavailable","Message":"I/O error on POST request for \"http://qdone.openstack.sdns.ksyun.com:6004/v2/8e7be2f85d47444c82f0268b40e7b1e1/os-ksc-resources/check\": connect timed out"}}400
纯净模式常规模式

纯净模式

点击可全屏预览文档内容