ResetInstance
1. API Description
This API is used to reinstall the operating system on an elastic compute instance.
Prerequisites
Query images: call DescribeImages to check information on images.
2. Input Parameters
The following request parameter list only provides API request parameters.
instanceId
Yes
String
Instance ID(s).
To obtain the instance ID, you can call DescribeInstances and look for instanceId in the response.
imageId
No
String
Specify a valid image ID.
To obtain valid image ID, you can call DescribeImages and look for imageId in the response. You can also reinstall it according to the original image.
password
No
String
Instance password.
The parameter must be 8-16 characters, including:
lowercase letters: [a-z]
uppercase letters: [A-Z]
digits: 0-9
special characters:
`~!@$^*-_=+|;:,.?
You can set either a password or a keyId, but not both; Windows and Generic images support neither option.
keyId
No
String
SSH key pair ID. For example: key-YWD2QFOl.
Your SSH key pair contains several public keys that can be placed on your server. You can access your instance with the private key. Call DescribeKeyPairs to obtain key pair information.
You can set either a password or a keyId, but not both; Windows and Generic images support neither option.
timezone
No
String
If not specified, the instance will be reinstalled using its original time zone.
enableAgent
No
String
Whether QGA is enabled or not.
userData
No
String
Initialization command.
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" %} Reinstall the specified instance by providing an image and password.
`
``json POST /api/v2/zec HTTP/1.1 Host: console.zenlayer.com Content-Type: application/json X-ZC-Action: ResetInstance
Request: { "instanceId": "instanceId", "imageId": "image-xxxxxxxxx", "password": "Example+123" }
Response: { "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453", "response": { "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453" } }
Last updated