SIGN IN / UP
    opened image

    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):

    Parameter Example Value Required Parameter Value Description
    func instances.fleio.boot_from_iso 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 Response type to expect
    sok ok Yes Operation confirmation
    elid 5203773 Yes Instance ID
    select_boot_from_iso ffa4a7c1-9e36-49a1-8770-acfb2878141f Yes UUID of the image to be used. It is recommended to use an image with an ISO disk type
    zone pub Yes Type 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):

    Parameter Value
    func instances.fleio.boot_from_iso
    auth 21fc199...c43f71
    out json
    sok ok
    elid 5203773
    select_boot_from_iso ffa4a7c1-9e36-49a1-8770-acfb2878141f
    zone pub

     

    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:

    UUID Image Name OS Name Visibility

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

    myImage Solaris own

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

    boo AlmaLinux own

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

    foo AlmaLinux own

    ffa4a7c1-9e36-49a1-8770-acfb2878141f

    - [ISO] systemrescue-11.00-amd64 pub

     

    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):

    Parameter Example Value Required Parameter Value Description
    func instances.fleio.unrescue Yes Function to exit «Boot from ISO» 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 Response type to expect
    elid 5203773 Yes Instance 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: