Creating an Image
To create an image, execute the following request:
URL:
https://api.zomro.com/
Method: POST
Request Body (Form-data):
Parameter | Example Value | Required Parameter | Value Description |
func | v2.image.order.param | Yes | Function to create a schedule for creating a backup |
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 |
image_type | image | Yes | Type of created element. Available value - image |
skipbasket | on | Yes | It is recommended to specify "on", as in the case of "off", the image will not be created |
image_name | MyImage | Yes | Image name |
region | Netherlands-2 | Yes | Data center where the image will be saved |
min_disk | 1 | Yes | Minimum disk size in GB required in the instance to use the image |
min_ram | 1 | Yes | Minimum RAM size in GB required in the instance to use the image |
disk_format | iso | Yes | Type of image to create. Available parameters: "iso", "ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vdi". |
os_distro | ubuntu | Yes | Name of the OS for which the image is being created |
os_version | 22 | No | OS version |
architecture | x86_64 | Yes | OS architecture. Available parameters: "x86_64", "i686", "ia64" |
url | https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso | Yes | Direct link to the image |
protected | on | Yes | Whether to allow deleting the image. Available parameters: "on", "off" |
pricelist | 6854 | Yes | Service ID corresponding to the image service |
order_period | -50 | Yes | Order 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):
Parameter | Value |
func | v2.image.order.param |
auth | 21fc199...c43f71 |
out | json |
sok | ok |
image_type | image |
skipbasket | on |
image_name | Ubuntu24 |
region | Netherlands-2 |
min_disk | 1 |
min_ram | 1 |
disk_format | iso |
os_distro | ubuntu |
os_version | 24 |
architecture | x86_64 |
url | https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso |
protected | on |
pricelist | 6854 |
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):
Parameter | Example Value | Required Parameter | Value Description |
func | image | Yes | Function to get all images |
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 |
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):
Parameter | Example Value | Required Parameter | Value Description |
func | image.edit | Yes | Function to edit the image |
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 | 5206258 | Yes | Image ID. This value can be obtained in the response to the request to get all images |
image_name | Ubuntu24_new | No | Image name |
min_disk | 2 | No | Minimum disk size required in the instance to use this image |
min_ram | 3 | No | Minimum RAM size required in the instance to use this image |
os_distro | altlinux | No | OS name |
os_version | 8 | No | OS version |
architecture | x86_64 | No | Image architecture |
protected | off | No | Whether 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):
Parameter | Example Value | Required Parameter | Value Description |
func | image.delete | Yes | Function to delete the image |
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 | 5206258 | Yes | Image 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:
- 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 Backup Schedule
- API - Interacting with Rescue
- API - Interaction with Backup
- API - Interacting with Snapshots
- API - Interacting with Boot From ISO