ResetInstance
Last updated
Last updated
This API is used to reset the operating system (OS) of an instance.
Query image: call DescribeImages
to check information on image.
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.
The following request parameter list only provides API request parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Reset an instance with a specified image and a specified password.
Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Parameter Name | Type | Description |
---|---|---|
HTTP Status Code | Error Code | Description |
---|---|---|
instanceId
Yes
String
Instance ID(s).
To obtain the instance IDs, you can call DescribeInstances
and look for instanceId
in the response.
imageId
No
String
Valid image ID.
To obtain the image IDs, you can call DescribeImages
and look for imageId
in the response. If no image is specified, the current image will be used for OS reset.
password
No
String
Instance login password.
The parameter must be 8-16 characters, including:
lowercase letters: [a-z]
uppercase letters: [A-Z]
digits: 0-9
special characters: !@#$%^&*`~()-+=
You must and can only pass the value of either password
or keyId
.
keyId
No
String
SSH key pair ID.
Your SSH key pair contains several public keys that can be placed on your server. You can access your instance with the private key. SSH key pairs and passwords cannot to set at the same time. SSH key pairs are not supported for Windows operating system.
For example: key-YWD2QFOl
You must and can only pass the value of either password
or keyId
.
requestId
String
The unique request ID, which is returned for each request. RequestId is required for locating a problem.
404
INVALID_INSTANCE_NOT_FOUND
Instance does not exist.
404
INVALID_IMAGE_NOT_FOUND
Image not found.
400
INVALID_PARAMETER_VALUE_PASSWORD_MALFORMED
Invalid password.
400
INVALID_IMAGE_SIZE_EXCEED
Image size exceeds the storage space of system disk.