opened image

API - Operation Rebuild

To initiate the Rebuild operation via the API, you need to use a specific function and pass the necessary request parameters. Below are the request details, including the URL, method, and required parameters that need to be specified for the successful execution of the operation.

To initiate the Rebuild operation, use the following function.

 

URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

 

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio.rebuildYesFunction to initiate the server rebuild
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesExpected response type
sokokYesOperation confirmation
elid5113119YesID of the service to perform the operation on
zoneimageYesSection from which to use images for OS reinstallation
select_rebuild18d0ee2e-4d57-4f40-9b56-03c1773b5831YesUID of the operating system to reinstall the instance. The UID of the operating system can be obtained from the function v2.instances.order.pricelist. More details on how to use it are described here
enablesshoffYesWhether to use an SSH key or not. Can take values off or on.
passwordMypassword1NoServer access password. For Linux, the password for the root user. For Windows, the password for the Administrator user. Do not pass if the parameter enablessh=on.
Also, the password must contain at least 1 uppercase English letter, 1 numeric character, and a minimum of 8 characters.  
ssh_keys490No

ID of the SSH key to add to the server after OS installation. Do not pass if the parameter use_ssh_key=off.
The ID of the SSH key can be obtained from the function v2.instances.order.pricelist. More details on how to use it are described here

 

Example of executing rebuild

For example, we use a service with Ubuntu 20.04 and perform a rebuild to AlmaLinux 8, and set a password for the root user - Mypassword1.

 

URL: 

https://api.zomro.com/

 

Method: POST

Request Body (Form-data):

 

ParameterValue
funcinstances.fleio.rebuild
auth21fc199...c43f71
outjson
sokok
elid5113119
zoneimage
select_rebuild18d0ee2e-4d57-4f40-9b56-03c1773b5831
enablesshoff
passwordMypassword1

 

Here is an example request that can be executed from the console:

curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio.rebuild"' \
--form 'auth="f1662dcabc6b96c85be3af64"' \
--form 'elid="5113119"' \
--form 'zone="image"' \
--form 'select_rebuild="18d0ee2e-4d57-4f40-9b56-03c1773b5831"' \
--form 'enablessh="off"' \
--form 'password="Mypassword12"' \
--form 'sok="ok"' \
--form 'out="json"'

 

This operation takes some time as the operating system is reinstalled during the operation. Depending on the OS, the waiting time may vary.

After executing the request, we can verify that the operating system has been reinstalled in the personal account or via the API


 

The result of the operation can also be seen in the operation history in the graphical interface.

 

 

As we can see, the operation was successful.

 

We also recommend studying articles that may be useful for interacting with Cloud VPS products using the API: