opened image

API - Interaction with Backup Schedule

Creating a Backup Schedule

 

To create a backup schedule, execute the following request:

 

URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcinstances.fleio_bckps.schedule.editYesFunction to create a backup schedule
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesExpected response type
sokokYesOperation confirmation
plid5203773YesID of the instance for which to create a backup schedule
nameMyBackupYesName of the backup schedule
rotation_days1,2,3,4,5,6,0YesDays to create backups. The week starts on Sunday, which has ID - 0. Monday has value 1. Other days of the week have corresponding values.
rotation_time02:01YesTime to create the backup

 

Example of Creating a Backup Schedule for a Service

 

For example, let's use the service:

 

 

And create a new backup schedule from Monday to Friday at 02:01

 

URL: 

https://api.zomro.com/

 

Method: POST

Request Body (Form-data):

ParameterValue
funcinstances.fleio_bckps.edit
auth21fc199...c43f71
outjson
sokok
plid5203773
nameMySchedule
rotation_days1,2,3,4,5,6
rotation_time02:01

 

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.schedule.edit"' \
--form 'auth="7e0cb9825a87e4c1a150dc9b"' \
--form 'out="json"' \
--form 'name="MySchedule"' \
--form 'rotation_days="1,2,3,4,5,6"' \
--form 'rotation_time="02:01"' \
--form 'plid="5203773"' \
--form 'sok="ok"'

 

After executing the request, we see that the new backup schedule was created successfully:

 

 

Also, using the API, it is possible to get a list of all created backup schedules. 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_bckps.scheduleYes    
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesExpected response type
plid5203773YesID of the instance whose backup schedules are to be retrieved

 

For example, let's try to get the backup schedule for service 5203773. In the previous step, we created a backup schedule. 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.schedule"' \
--form 'auth="7e0cb9825a87e4c1a150dc9b"' \
--form 'out="json"' \
--form 'elid="5203773"'

We get the following result:

{
    "doc": {
        ...
        "elem": [
            {
                "create_date": {
                    "$": "2024-07-24"
                },
                "id": {
                    "$": "14"
                },
                "instance_id": {
                    "$": "5203773"
                },
                "name": {
                    "$": "MySchedule"
                },
                "rotation_days": {
                    "$": "Monday Tuesday Wednesday Thursday Friday Saturday "
                },
                "rotation_time": {
                    "$": "02:01"
                },
                "servername": {
                    "$": "MyServer"
                }
            }
        ],
    }
}

 

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

doc.elem.[]

 

From this response, we get the following data:

Field NameDescription

create_date

Time of creating the backup schedule

id

ID of the backup within bill manager

instance_id

ID of the instance within bill manager

name

Name of the backup

rotation_days

Days when the backup is created

rotation_time

Time when the backup will be created

servername

Server name.

 

To delete a backup schedule, execute the following request:

 URL: 

https://api.zomro.com/

Method: POST

Request Body (Form-data):

ParameterExample ValueRequired ParameterValue Description
funcimage.deleteYesFunction to delete the backup schedule
auth21fc199...c43f71NoSession token. This is one of the authorization options. More details on other options are described here
outjsonYesExpected response type
elid14YesID of the schedule to be deleted

 

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

curl --location 'https://api.zomro.com/' \
--form 'func="instances.fleio_bckps.schedule.delete"' \
--form 'auth="7c70d43c92c610c4c6c42c2c"' \
--form 'out="json"' \
--form 'elid="14"'

After executing the request, check the result by viewing it through the web interface:

 

As we can see, the backup schedule was successfully deleted. 

 

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