ResetInstance

1. API Description

This API is used to reset the operating system (OS) of an instance.

Prerequisites

Note

  • If imageId is specified, it will be used for OS reset, otherwise the current image will be used for OS reset.

  • The system disk will be formatted and reset. Please ensure that there is no important files in the system disk.

  • If no password is specified, you will receive a random code in mailbox.

  • You can only perform this operation on instances whose status is STOPPED and are not in the recycle bin.

  • If the API is called successfully, the instance status will become REBUILDING. After the instance is reset, its status will become RUNNING again. You can use DescribeInstancesStatus to query the status of the instance.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Reset an instance with a specified image and a specified password.

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

Request:
{
    "instanceId": "instanceId",
    "imageId": "img-xxxxxxxxx",
    "password": "Example+123"
}

Response:
{
  "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453",
  "response": {
    "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453"
  }
}

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