opened image

API - Interaction with Backup

This document describes the process of creating, viewing, and deleting backups for an instance using the Zomro service API. The provided request examples will help you quickly understand the basic operations needed to manage backups through the API.

 

Creating a Backup

 

To create a backup, execute the following request:

 

URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio_bckps.editYesFunction to create a backup
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesResponse type to expect
sokokYesOperation confirmation
plid5203773YesID of the instance for which to create a backup
nameMyBackupYesBackup name

 

Example of creating a backup for a service

For example, we use the service:

 

URL: 

https://api.zomro.com/

 

Method: POST

Request Body (Form-data):

ParameterValue
funcinstances.fleio_bckps.edit
auth21fc199...c43f71
outjson
sokok
plid5203773
nameMyBackup

 

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

 

curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio_bckps.edit"' \
--form 'auth="d3ec30e337e01078a1d185cc"' \
--form 'out="json"' \
--form 'sok="ok"' \
--form 'plid="5203773"' \
--form 'name="MyBackup"'

 

After executing the request, we see that the backup is in the process of being created. As we can see, the backup has the status Saving:

​​​​​​​

 

After the backup creation is complete, the backup status will change from Saving to Active:

 

As we can see, the service status is Active.

 

How to Get a List of Backups Using the API

 

Also, using the API, you can get a list of backups. To do this, execute the following request format:

 URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio_bckpsYesFunction to get all backups
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesResponse type to expect
plid5203773YesID of the instance whose backups are to be retrieved

 

For example, let's try to get backups for service 5203773. In the previous step, we created 1 backup. Let's try to retrieve it.

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

curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio_bckps"' \
--form 'auth="8409b4eea786e3cad35eacf7"' \
--form 'out="json"' \
--form 'elid="5203773"'

We get the following result:

{
    "doc": {
        ...
        "elem": [
            {
                "architecture": {
                    "$": "x86_64"
                },
                "backup_type": {
                    "$": "manual"
                },
                "createdate": {
                    "$": "2024-07-23"
                },
                "disk_format": {
                    "$": "qcow2"
                },
                "fleio_id": {
                    "$": "b26c0f34-48b2-4cb2-b4eb-388eac959df6"
                },
                "fleio_status": {
                    "$": "Active"
                },
                "hypervisor_type": {
                    "$": "any_hypervisor"
                },
                "id": {
                    "$": "5203980"
                },
                "image_size": {
                    "$": "3"
                },
                "item_real_status": {
                    "$": "2"
                },
                "min_disk": {
                    "$": "20"
                },
                "min_ram": {
                    "$": "0"
                },
                "name": {
                    "$": "MyBackup"
                },
                "os_distro": {
                    "$": "Ubuntu"
                },
                "os_version": {
                    "$": "22.04 x64"
                },
                "protected": {
                    "$": "off"
                },
                "region": {
                    "$": "Netherlands-2"
                },
                "visibility": {
                    "$": "private"
                }
            }
        ],
    }
}

 

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

doc.elem.[]

 

From this response, we get the following data:

Field NameDescription

architecture

Virtual machine architecture

backup_type

How the backup was created: Manually or on schedule

createdate

Backup creation time

disk_format

Backup file type

fleio_id

Unique UUID in the fleio system

fleio_status

Backup status. The value Active means the backup is created

hypervisor_type

Hypervisor type for the virtual machine

id

Backup ID within bill manager

image_size

Actual backup size. Determined after the backup creation is complete

item_real_status

Service status within billmanager

min_disk

Minimum disk size on the server needed to restore this backup

min_ram

Minimum RAM size on the server needed to restore this backup

name

Backup name

os_distro

Operating system name

os_version

Operating system version

protected

Indicates whether the backup can be deleted. If "off", the backup can be deleted. If "on", the backup cannot be deleted.

region

Data center name where the backup is located

visibility

Backup access status. The only available value is "Private"

 

How to Delete a Backup

​​​​​​​

To delete a backup, execute the following request:

 URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ID of the instance whose backups are to be retrieved

ParameterExample ValueRequired ParameterValue Description
funcimage.deleteYesFunction to delete a backup
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesResponse type to expect
plid5203773Yes
elname

5203980

YesID of the backup to be deleted
elid

5203980

YesID of the backup to be deleted
sokokYesOperation confirmation

 

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

curl --location 'https://api.zomro.com/' \
--form 'func="image.delete"' \
--form 'auth="72307c8cfc94e631d835438f"' \
--form 'out="json"' \
--form 'sok="ok"' \
--form 'plid="5203773"' \
--form 'elname="5203980"' \
--form 'elid="5203980"'

After executing the request, you can check the result using the "instances.fleio_bckps" function or by viewing it through the web interface:

​​​​​​​

 

As we can see, the backup was successfully deleted. 

 

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