Get Virtualizor

Backup VPS Details

Use the Backup VPS Details API to get the backup information of the VPS. The information consists of the list of the backed up file paths, along with the size of the image in bytes, which are listed according to the date on which the backup of the VPS took place.

For more information, you can refer this Backup Plans guide.

HTTP Request

https://hostname:4085/index.php?act=vpsrestore&op=get_vps

Parameters

NameMethodValueDescriptionRequired
actGETvpsrestoreThe action will return the backup information of the VPSYes
opGETtextThe 'op' should be 'get_vps' for getting the VPS informationYes
datePOSTintDate of which you want vps backups
(For example 20200313)
NO
vpsidPOSTIntThe ID of the vps whose backup information is neededYes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['vpsid'] = 79;

    $output = $admin->vps_backup_list($post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Restore VPS Backups",
    "directories": [
        "/tmp/api_backup"
    ],
    "backup_list": {
        "20180918": [
            {
                "abs_path": "/tmp/api_backup/20180918/79.img",
                "size": 2147483648
            }
        ]
    },
    "vps_backup_server": "0",
    "vps_backup_dir": "/tmp/api_backup",
    "timenow": 1537293793,
    "time_taken": "0.223"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list