SIGN IN / UP
    opened image

    Creating a Backup Schedule

     

    To create a backup schedule, execute the following request:

     

    URL: 

    https://api.zomro.com/

    Method: POST

    Request Body (Form-data):

    Parameter Example Value Required Parameter Value Description
    func instances.fleio_bckps.schedule.edit Yes Function to create a backup schedule
    auth 21fc199...c43f71 No Session token. This is one of the authorization options. More details on other options are described here
    out json Yes Expected response type
    sok ok Yes Operation confirmation
    plid 5203773 Yes ID of the instance for which to create a backup schedule
    name MyBackup Yes Name of the backup schedule
    rotation_days 1,2,3,4,5,6,0 Yes Days 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_time 02:01 Yes Time 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):

    Parameter Value
    func instances.fleio_bckps.edit
    auth 21fc199...c43f71
    out json
    sok ok
    plid 5203773
    name MySchedule
    rotation_days 1,2,3,4,5,6
    rotation_time 02: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):

    Parameter Example Value Required Parameter Value Description
    func instances.fleio_bckps.schedule Yes     
    auth 21fc199...c43f71 No Session token. This is one of the authorization options. More details on other options are described here
    out json Yes Expected response type
    plid 5203773 Yes ID 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 Name Description

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

    Parameter Example Value Required Parameter Value Description
    func image.delete Yes Function to delete the backup schedule
    auth 21fc199...c43f71 No Session token. This is one of the authorization options. More details on other options are described here
    out json Yes Expected response type
    elid 14 Yes ID 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: