opened image

API - Interaction with Image

Creating an Image

To create an image, execute the following request:

 

URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcv2.image.order.paramYesFunction to create a schedule for creating a backup
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesExpected response type
sokokYesOperation confirmation
image_typeimageYesType of created element. Available value - image
skipbasketonYesIt is recommended to specify "on", as in the case of "off", the image will not be created
image_nameMyImageYesImage name
regionNetherlands-2YesData center where the image will be saved
min_disk1YesMinimum disk size in GB required in the instance to use the image
min_ram1YesMinimum RAM size in GB required in the instance to use the image
disk_formatisoYesType of image to create. Available parameters: "iso", "ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vdi".
os_distroubuntuYesName of the OS for which the image is being created
os_version22NoOS version
architecturex86_64YesOS architecture. Available parameters: "x86_64", "i686", "ia64"
urlhttps://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.isoYesDirect link to the image
protectedonYesWhether to allow deleting the image. Available parameters: "on", "off"
pricelist6854YesService ID corresponding to the image service
order_period-50YesOrder period. For the image service type, only daily payment is used

 

Example of creating an image

For example, let's create an image from Ubuntu 24.04 https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso:

 

URL: 

https://api.zomro.com/

 

Method: POST

Request Body (Form-data):

ParameterValue
funcv2.image.order.param
auth21fc199...c43f71
outjson
sokok
image_typeimage
skipbasketon
image_nameUbuntu24
regionNetherlands-2
min_disk1
min_ram1
disk_formatiso
os_distroubuntu
os_version24
architecturex86_64
urlhttps://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso
protectedon
pricelist6854
order_period-50

 

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

 

curl --location 'https://api.zomro.com/' \
--form 'func="v2.image.order.param"' \
--form 'auth="0f6744198ec41bb23fe1c923"' \
--form 'out="json"' \
--form 'sok="ok"' \
--form 'image_type="image"' \
--form 'skipbasket="on"' \
--form 'image_name="Ubuntu24"' \
--form 'region="Netherlands-2"' \
--form 'min_disk="1"' \
--form 'min_ram="1"' \
--form 'disk_format="iso"' \
--form 'os_distro="ubuntu"' \
--form 'os_version="22"' \
--form 'architecture="x86_64"' \
--form 'url="https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso"' \
--form 'protected="on"' \
--form 'pricelist="6854"' \
--form 'order_period="-50"'

 

After executing the request, we see that the image creation has started. The current status is "Saving":

 

After the image is created, the status will change from "Saving" to "Active":

 

 How to Get a List of All Images Using the API

 

 

To do this, execute the following request format:

 URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcimageYesFunction to get all images
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesExpected response type

Let's try to execute the following request in the console:

curl --location 'https://api.zomro.com/' \
--form 'func="image"' \
--form 'auth="1176dc887b147a3eb1da748e"' \
--form 'out="json"'

We get the following result:

{
    "doc": {
        ...
        "elem": [
                        {
                "abusesuspend": {
                    "$": "off"
                },
                "architecture": {
                    "$": "x86_64"
                },
                "archived": {
                    "$": "off"
                },
                "autosuspend": {
                    "$": "off"
                },
                "billdaily": {
                    "$": "on"
                },
                "billhourly": {
                    "$": "off"
                },
                "change_pl": {
                    "$": "0"
                },
                "change_pricelist": {
                    "$": "off"
                },
                "changepolicy": {
                    "$": "2"
                },
                "cost": {
                    "$": "0.00 EUR / Day"
                },
                "costperiod": {
                    "$": "-50"
                },
                "createdate": [
                    {
                        "$": "2024-07-24"
                    },
                    {
                        "$": "2024-07-24"
                    }
                ],
                "currency_id": {
                    "$": "153"
                },
                "currency_str": {
                    "$": "EUR"
                },
                "description": {},
                "disk_format": {
                    "$": "iso"
                },
                "employeesuspend": {
                    "$": "off"
                },
                "expiredate": {
                    "$": "Daily charges"
                },
                "fleio_id": {
                    "$": "802c0ad6-c918-4769-8111-0a165a076ca4"
                },
                "fleio_status": {
                    "$": "Active"
                },
                "has_ip_pricelist": {
                    "$": "off"
                },
                "hypervisor_type": {
                    "$": "Any hypervisor"
                },
                "i_expiretime": {
                    "$": "14:44:24                },
                "i_opentime": {
                    "$": "15:45:12"
                },
                "id": {
                    "$": "5206258"
                },
                "image_name": {
                    "$": "Ubuntu24"
                },
                "image_size": {
                    "$": "3"
                },
                "image_type": {
                    "$": "Image"
                },
                "intname": [
                    {
                        "$": "image"
                    },
                    {
                        "$": "image"
                    }
                ],
                "it_accurate_billing": {
                    "$": "no"
                },
                "item_cost": {
                    "$": "0.0000"
                },
                "item_real_status": {
                    "$": "2"
                },
                "item_status": {
                    "$color": "green",
                    "$orig": "2",
                    "$": "Active"
                },
                "itemtype": {
                    "$": "27163"
                },
                "min_disk": {
                    "$": "1"
                },
                "min_ram": {
                    "$": "1"
                },
                "module_failed": {
                    "$": "off"
                },
                "module_upload_doc": {
                    "$": "off"
                },
                "name": {
                    "$": "Image #5206258"
                },
                "no_instruction": {
                    "$": "on"
                },
                "order_disabled": {
                    "$": "off"
                },
                "os_distro": {
                    "$": "Ubuntu"
                },
                "os_version": {
                    "$": "22"
                },
                "period": {
                    "$": "-50"
                },
                "pmmodule": {
                    "$": "pmimagemodule"
                },
                "price_on_request": {
                    "$": "off"
                },
                "pricelist": {
                    "$": "Image"
                },
                "pricelist_id": {
                    "$": "6854"
                },
                "processingmodule_failed": {
                    "$": "off"
                },
                "processingnode": {},
                "protected": {
                    "$orig": "on",
                    "$": "Enable"
                },
                "real_expiredate": {
                    "$": "2024-07-25"
                },
                "region": {
                    "$": "Netherlands-2"
                },
                "scheduledclose": {
                    "$": "off"
                },
                "show_changepassword": {
                    "$": "off"
                },
                "show_domain_validation_button": {
                    "$": "off"
                },
                "show_hardreboot": {
                    "$": "off"
                },
                "show_movetovdc": {
                    "$": "off"
                },
                "show_reboot": {
                    "$": "on"
                },
                "show_supportpassword": {
                    "$": "off"
                },
                "show_vdc_loadbalancer": {
                    "$": "off"
                },
                "show_vdc_network": {
                    "$": "off"
                },
                "show_vdc_router": {
                    "$": "off"
                },
                "show_vdc_vm": {
                    "$": "off"
                },
                "show_vdc_volume": {
                    "$": "off"
                },
                "show_webconsole": {
                    "$": "off"
                },
                "specialstatus": {
                    "$": "0"
                },
                "stat_enabled": {
                    "$": "on"
                },
                "status": {
                    "$": "2"
                },
                "subaccount": {
                    "$": "351336"
                },
                "sync_feature": {
                    "$": "off"
                },
                "transition": {
                    "$": "off"
                },
                "visibility": {
                    "$": "Private"
                }
            },
        ],
    }
}

 

We are interested in the data obtained in the following nesting:

doc.elem.[]

 

To edit an image, execute the following request:

 URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcimage.editYesFunction to edit the image
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesExpected response type
elid5206258YesImage ID. This value can be obtained in the response to the request to get all images
image_nameUbuntu24_newNoImage name
min_disk2NoMinimum disk size required in the instance to use this image
min_ram3NoMinimum RAM size required in the instance to use this image
os_distroaltlinuxNoOS name
os_version8NoOS version
architecturex86_64NoImage architecture
protectedoffNoWhether the image can be deleted

Let's try to execute the following request in the console:

curl --location 'https://api.zomro.com/' \
--form 'func="image.edit"' \
--form 'auth="00bef0b977845f71a1583a2c"' \
--form 'out="json"' \
--form 'sok="ok"' \
--form 'elid="5206258"' \
--form 'image_name="Ubuntu24_new"' \
--form 'min_disk="2"' \
--form 'min_ram="3"' \
--form 'os_distro="altlinux"' \
--form 'os_version="8"' \
--form 'architecture="x86_64"' \
--form 'protected="on"'

After executing the request, you can verify that the image data has changed:

 

Deleting an Image

 

To delete an image, execute the following request:

 

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcimage.deleteYesFunction to delete the image
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options can be found here
outjsonYesExpected response type
elid5206258YesImage ID. This value can be obtained in the response to the request to get all images

Let's try to execute the following request in the console:

curl --location 'https://api.zomro.com/' \
--form 'func="image.delete"' \
--form 'auth="9f467da30d0bd6c56fed1b58"' \
--form 'out="json"' \
--form 'elid="5206258"'

It is also worth noting that to delete an image, the "protected" status must be set to "off".

After executing the request, we see the successful deletion of the image.

 

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