This article describes how to perform a Rescue operation using the API.
Using Rescue
To start the Rescue process for an instance, make a request in the following format:
URL:
https://api.zomro.com/
Method: POST
Request Body (Form-data):
Parameter | Example Value | Required Parameter | Value Description |
func | instances.fleio.rescue | Yes | Function to use Boot from ISO |
auth | 21fc199...c43f71 | No | Session token. This is one of the authorization options. More details on other options can be found here |
out | json | Yes | Expected response type |
sok | ok | Yes | Operation confirmation |
elid | 5203773 | Yes | Instance ID |
select_boot | f8f2573f-56c4-44c5-8469-84eee4aa64e7 | Yes | UUID of the image to be used |
password | MyPassword1 | No | Server access password in Rescue mode. It is recommended to set it to have access to the server |
zone | pub | Yes | Zone type where the image is located. Available parameters: «own», «pub». |
Example of switching an Instance to Boot From ISO mode
For example, we use the service:
and load the following image:
URL:
https://api.zomro.com/
Method: POST
Request Body (Form-data):
Parameter | Value |
func | instances.fleio.rescue |
auth | 21fc199...c43f71 |
out | json |
sok | ok |
elid | 5203773 |
select_boot_from_iso | f8f2573f-56c4-44c5-8469-84eee4aa64e7 |
zone | pub |
password | MyPassword1 |
Here is an example of a request that can be executed from the console:
curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio.rescue"' \
--form 'auth="43137b5f35a6ba4ee01f4a4e"' \
--form 'out="json"' \
--form 'elid="5203773"' \
--form 'sok="ok"' \
--form 'select_boot="f8f2573f-56c4-44c5-8469-84eee4aa64e7"' \
--form 'password="MyPassword1"' \
--form 'zone="pub"'
After executing the request, we see that the instance has switched to «Rescue» mode. This is confirmed by the result in the photo:
Also, if the sok parameter is not passed, the request will be executed in preview mode. By executing this request, you can get the available images for switching to rescue from the selected image. For example, let's execute the following request without the «sok» parameter:
curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio.rescue"' \
--form 'auth="43137b5f35a6ba4ee01f4a4e"' \
--form 'out="json"' \
--form 'elid="5203773"'
We get the following response:
{
"doc": {
...
"slist": [
{
"$name": "zone",
"val": [
{
"$key": "pub",
"$": "pub"
},
{
"$key": "own",
"$": "own"
}
]
},
{
"$name": "select_boot",
"val": [
{
"$depend": "pub",
"$key": "f8f2573f-56c4-44c5-8469-84eee4aa64e7",
"$": "Ubuntu 22.04"
},
{
"$depend": "pub",
"$key": "0bf4deb2-855c-4863-8518-6006d804adbb",
"$": "Debian 10"
},
{
"$depend": "pub",
"$key": "18d0ee2e-4d57-4f40-9b56-03c1773b5831",
"$": "AlmaLinux 8"
},
{
"$depend": "pub",
"$key": "1d9dda4c-34b0-4304-a90a-8f3018722fa2",
"$": "Rocky-Linux-8"
},
{
"$depend": "pub",
"$key": "2af0af94-0e6e-4ef3-8837-d41fdbfa3564",
"$": "Windows Server 2016"
},
{
"$depend": "pub",
"$key": "3010ae60-0185-4021-98da-f50013147ebd",
"$": "Debian 11"
},
{
"$depend": "pub",
"$key": "479c96f1-ccc6-47a2-952c-c9e3bbdc8d07",
"$": "Ubuntu 20.04"
},
{
"$depend": "pub",
"$key": "5da4ad83-45f6-4c0e-9a7e-7a7c18b2be6c",
"$": "AlmaLinux 9"
},
{
"$depend": "pub",
"$key": "7d7911e3-7178-4f36-a308-d841db5fe654",
"$": "CentOS Stream 9"
},
{
"$depend": "pub",
"$key": "92fabac2-69cc-46ad-8439-c377e0c90632",
"$": "Ubuntu 23.04"
},
{
"$depend": "pub",
"$key": "93878ba5-6b9e-4924-a4be-34edb623f808",
"$": "Debian 12"
},
{
"$depend": "pub",
"$key": "a8b7bcb3-6698-4264-b413-f2b866a46a70",
"$": "Rocky-Linux-9"
},
{
"$depend": "pub",
"$key": "b10434c0-d839-428f-a919-cac733fd6552",
"$": "Windows Server 2019"
},
{
"$depend": "pub",
"$key": "bda2467e-e192-4e4e-becc-cda2e71b9767",
"$": "Windows Server 2022"
},
{
"$depend": "own",
"$name": "foo",
"$key": "a9e7c223-5f11-4546-a298-6af546bebde6",
"$": "Centos 9 x64"
},
]
}
],
}
}
Analyzing this response structure, the data of interest is found in the following nesting:
doc.slist.[]
As we can see, the available images are:
UUID | Image Name | OS Name | Visibility |
f8f2573f-56c4-44c5-8469-84eee4aa64e7 | - | Ubuntu 22.04 | pub |
0bf4deb2-855c-4863-8518-6006d804adbb | - | Debian 10 | pub |
18d0ee2e-4d57-4f40-9b56-03c1773b5831 | - | AlmaLinux 8 | pub |
1d9dda4c-34b0-4304-a90a-8f3018722fa2 | - | Rocky-Linux-8 | pub |
2af0af94-0e6e-4ef3-8837-d41fdbfa3564 | - | Windows Server 2016 | pub |
3010ae60-0185-4021-98da-f50013147ebd | - | Debian 11 | pub |
479c96f1-ccc6-47a2-952c-c9e3bbdc8d07 | - | Ubuntu 20.04 | pub |
5da4ad83-45f6-4c0e-9a7e-7a7c18b2be6c | - | AlmaLinux 9 | pub |
7d7911e3-7178-4f36-a308-d841db5fe654 | - | CentOS Stream 9 | pub |
92fabac2-69cc-46ad-8439-c377e0c90632 | - | Ubuntu 23.04 | pub |
93878ba5-6b9e-4924-a4be-34edb623f808 | - | Debian 12 | pub |
a8b7bcb3-6698-4264-b413-f2b866a46a70 | - | Rocky-Linux-9 | pub |
b10434c0-d839-428f-a919-cac733fd6552 | - | Windows Server 2019 | pub |
bda2467e-e192-4e4e-becc-cda2e71b9767 | - | Windows Server 2022 | pub |
a9e7c223-5f11-4546-a298-6af546bebde6 | foo | Centos 9 x64 | own |
An image with the «pub» access modifier is available to all users. However, with «own» - it is available only to the image owner.
Also, to exit the «Rescue» mode, execute the following API request in the following format:
URL:
https://api.zomro.com/
Method: POST
Request Body (Form-data):
Parameter | Example Value | Required Parameter | Value Description |
func | instances.fleio.unrescue | Yes | Function to exit «Rescue» mode |
auth | 21fc199...c43f71 | No | Session token. This is one of the authorization options. More details on other options can be found here |
out | json | Yes | Expected response type |
elid | 5203773 | Yes | Instance ID |
How to Disable «Rescue» Mode
For example, let's disable the «Rescue» mode for the Instance with ID 5203773.
Let's try to execute the following request in the console:
curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio.unrescue"' \
--form 'auth="0b31d69ab7b7b4839dfd6506"' \
--form 'out="json"' \
--form 'elid="5203773"'
After executing the request, we see that the service is active:
We also suggest studying articles that may be useful for interacting with Cloud VPS products using the API:
- API - Creating a Service
- API - Obtaining Information About Available Tariffs and Their Parameters
- API - Operation Start & Stop
- API - Operation Reboot
- API - Operation Rebuild
- API - Operation Delete
- API - Interaction with Image
- API - Interaction with Backup Schedule
- API - Interaction with Backup
- API - Interaction with Snapshots
- API - Interaction with Boot From ISO