ModifyInstanceType
1. API Description
This API is used to modify the specifications of a virtual machine instance.
Note
You can only perform this operation on instances whose status is
RUNNING
orSTOPPED
.If the
internetChargeType
of your instance isPREPAID:
Upgrade (target > current) operation will generate an order to be paid and deduct the amount required for this instance purchase. The request takes effect immediately.
Downgrade (target < current) operation will generate an order for the next billing cycle and will take effect by then.
If the
internetChargeType
of your instance isPOSTPAID
:The change takes immediate effect.
This API is an async API. Use
DescribeInstanceTypeStatus
to query specifications of an instance.Rules of specification change:
Changes between models with same series are allowed. For example, change the model of
c.1c2g
toc.2c4g
.Some changes between models with different series are allowed. For example, changes between
c
,g
andm
series.Some changes between models with different series are not allowed. For example, changes between
s
andh
series.
2. Input Parameters
The following request parameter list only provides API request parameters.
instanceId
Yes
String
ID of the instance to be modified.
instanceTypeId
Yes
String
ID of the target model to change.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request. RequestId is required for locating a problem.
orderNumber
String
Number of order.
4. Code Example
Modify the model of an 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 does not exist.
403
INVALID_INSTANCE_TYPE_NOT_CHANGED
Instance model does not changed.
400
OPERATION_FAILED_INSTANCE_TYPE_UNSUPPORTED
Unsupported model for the current instance.
403
OPERATION_DENIED_INSTANCE_EXIST_PLAN
A scheduling change exists.
403
OPERATION_DENIED_INSTANCE_PLAN_PROCESSING
A processing change exists.
400
UNSUPPORTED_OPERATION_INSTANCE_STATUS
Only operations on instances in RUNNING
or STOPPED
status are supported.
400
UNSUPPORTED_OPERATION_ZONE_NOT_SUPPORT
Specification change is not supported in the current zone.
400
UNSUPPORTED_OPERATION_INSTANCE_BEING_RECYCLE
Operations on instances in recycle bin are not supported.
404
INVALID_PRODUCT_NOT_FOUND
Model does not exist.
Last updated