opened image

API - Interaction with Boot From ISO

In this article, it is described how to perform the Boot from ISO operation using the API.

 

Using Boot from ISO

 

To start the Boot From ISO process for an instance, make a request in the following format:

 

URL: 

https://api.zomro.com/

Method: POST

Request body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio.boot_from_isoYesFunction to use Boot from ISO
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesResponse type to expect
sokokYesOperation confirmation
elid5203773YesInstance ID
select_boot_from_isoffa4a7c1-9e36-49a1-8770-acfb2878141fYesUUID of the image to be used. It is recommended to use an image with an ISO disk type
zonepubYesType of zone where the image is located. Available options: «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):

ParameterValue
funcinstances.fleio.boot_from_iso
auth21fc199...c43f71
outjson
sokok
elid5203773
select_boot_from_isoffa4a7c1-9e36-49a1-8770-acfb2878141f
zonepub

 

Here is an example of a request that can be made from the console:

 

curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio.boot_from_iso"' \
--form 'auth="d22467cab40fedf7674da126"' \
--form 'out="json"' \
--form 'elid="5203773"' \
--form 'sok="ok"' \
--form 'select_boot_from_iso="ffa4a7c1-9e36-49a1-8770-acfb2878141f"' \
--form 'zone="pub"'

 

After executing the request, we see that the instance has switched to «Boot from ISO» mode. The confirmation of this is 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 boot from iso 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.boot_from_iso"' \
--form 'auth="d22467cab40fedf7674da126"' \
--form 'out="json"' \
--form 'elid="5203773"' 


We get the following response:

 

{
    "doc": {
        ...
        "slist": [
            {
                "$name": "zone",
                "val": [
                    {
                        "$key": "own",
                        "$": "own"
                    },
                    {
                        "$key": "pub",
                        "$": "pub"
                    }
                ]
            },
            {
                "$name": "select_boot_from_iso",
                "val": [
                    {
                        "$depend": "own",
                        "$name": "myImage",
                        "$key": "35904b88-7c1f-47c6-911c-1198fbc6afeb",
                        "$": "Solaris "
                    },
                    {
                        "$depend": "own",
                        "$name": "boo",
                        "$key": "696c4ee2-6d19-4281-b301-599c220cd4f3",
                        "$": "AlmaLinux "
                    },
                    {
                        "$depend": "own",
                        "$name": "foo",
                        "$key": "5b71c86b-c384-4e6f-9fd8-3f22d000c2ff",
                        "$": "AlmaLinux "
                    },
                    {
                        "$depend": "pub",
                        "$key": "ffa4a7c1-9e36-49a1-8770-acfb2878141f",
                        "$": "[ISO] systemrescue-11.00-amd64"
                    }
                ]
            }
        ],
    
    }
}

 

Analyzing this response structure, the data of interest is found in the following nesting:

 

doc.slist.[]

 

As we can see, the following images are available to us:

UUIDImage NameOS NameVisibility

35904b88-7c1f-47c6-911c-1198fbc6afeb

myImageSolarisown

696c4ee2-6d19-4281-b301-599c220cd4f3

booAlmaLinuxown

5b71c86b-c384-4e6f-9fd8-3f22d000c2ff

fooAlmaLinuxown

ffa4a7c1-9e36-49a1-8770-acfb2878141f

-[ISO] systemrescue-11.00-amd64pub

 

An image with the «pub» access modifier is available to all users. However, with «own» - it is available only to the owner of the image.

 

Exiting «Boot From ISO» Mode


  

Also, to exit the «Boot From ISO» mode, execute the following API request in the following format:

 

URL: 

https://api.zomro.com/

Method: POST

Request body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio.unrescueYesFunction to exit «Boot from ISO» mode
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesResponse type to expect
elid5203773YesInstance ID

 

For example, let's disable the «Boot From ISO» 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: