ModifyInstanceType
1. API Description
This API (ModifyInstanceType) is used to changes the instance type of the specified elastic compute instance.
2. Input Parameters
The following request parameter list only provides API request parameters.
instanceId
Yes
String
ID of the instance to be changed.
It can be obtained by calling DescribeInstances.
instanceType
Yes
String
Target instance type to change to.
The value for a regular instance can be obtained through DescribeZoneInstanceConfigInfos, and the value for a GPU instance can be obtained through DescribeZoneGpuInstanceConfigInfos.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request.
RequestId is required for locating a problem.
4. Code Example
1. Modify the type of a VM instance.
2. Modify the type of a GPU instance.
3. Modify the type of an accelerator instance.
5. Developer Resources
Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
404
INVALID_INSTANCE_NOT_FOUND
Instance not found.
404
INVALID_INSTANCE_TYPE_NOT_FOUND
Instance type not found.
400
OPERATION_DENIED_INSTANCE_STATUS_NOT_SUPPORT
Current instance state does not allow this operation.
400
OPERATION_FAILED_INSTANCE_TYPE_UNSUPPORTED
The specified instance type is not supported for this instance.
400
OPERATION_DENIED_INSTANCE_TYPE_SAME_AS_CURRENT
The target instance type is the same as the current one. No modification is needed.
400
INVALID_IMAGE_SPEC_NOT_SUPPORT
The minimum specification required by the image exceeds the current instance type.
Last updated