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 is PREPAID:

    • 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 is POSTPAID:

    • 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 to c.2c4g.

    • Some changes between models with different series are allowed. For example, changes between c, g and m series.

    • Some changes between models with different series are not allowed. For example, changes between s and h series.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Modify the model of an instance.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyInstanceType
<Common Request Params>

Request:
{
  "instanceId": "instanceId",
  "instanceTypeId": "c.2c4g"
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {  
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "orderNumber": "xxxx"
  }
}

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.​

Last updated