ResetInstance
1. API Description
This API (ResetInstance) is used to reset the operating system (OS) of an instance.
Prerequisites
Query image: call
DescribeImagesto check information on image.
2. Input Parameters
The following request parameter list only provides API request parameters.
instanceId
Yes
String
Instance ID(s).
To obtain the instance IDs, you can call DescribeInstances and look for instanceId in the response.
password
No
String
Instance login password.
The parameter must be 8-16 characters, including:lowercase letters: [a-z]uppercase letters: [A-Z]digits: 0-9special 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.
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.
instanceName
No
String
Instance name to be displayed.
wanName
No
String
Public NIC name.
Only numbers and lowercase letters are allowed, starting with a letter with a length limit of 4 to 15 characters.
The default public NIC name is eth0.
lanName
No
String
Private NIC name.
Only numbers and lowercase letters are allowed, starting with a letter with a length limit of 4 to 15 characters.
The default private NIC name is eth1.
initScript
No
String
Initialization script. The value must be Base64-encoded, and the script content size must not exceed 32 KB.
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
{% tabs %} {% tab title="Example" %}
1. Reset an instance with the specified ID using a specified image and password.
2. Reset an instance with a specified initialization script.
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.
404
INVALID_IMAGE_NOT_FOUND
Image not found.
400
INVALID_PARAMETER_VALUE_PASSWORD_MALFORMED
Invalid password.
404
INVALID_IMAGE_SIZE_EXCEED
Image size exceeds the storage space of system disk.
403
INVALID_REGION_SCRIPT_NOT_SUPPORT
The region does not support scripts.
403
INVALID_REGION_SCRIPT_EXCEED_LENGTH
The length of the region script exceeds 32kb.
Last updated