Get Virtualizor

Delete Backup

Use Delete Backup API to delete existing backup of your VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=backup2&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETbackupsThe action which will delete backupsYes
svsPOSTvpsidThe vps which needs to be deleted. This is passed in URLYes
del_backupsPOST1/0If set then the vps backup will be deletedYes
vidPOSTvpsidThe vps which needs to be deleted.This is passed as a POST ParameterYes
datePOSTIntProvide date in format (YYYYMMDD)Yes
filePOSTtextProvide file name which you want to restore (If file name is not provided than latest file in file list will be deleted)Yes since 3.0.6.3

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  'your_api_key';
    $pass = 'your_Apia_pass';
    $ip = 'your_Server_ip';

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $vid = 3615;
    $post['date'] = 20210709;
    $post['file'] = '807_test_2021_07_09-10_40_10.tar.gz'; //since 3.0.6.3
    $post['delete'] = 1;
    $output = $admin->delete_backup($post, $vid);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "del_backup=1" -L "https://hostname:4083/index.php?act=backup2&svs=3615&api=json&apikey=your_api_key&apipass=your_api_pass"

Output

{
   "backups_list":[
      "20191018"
   ],
   "backup_limit":"-1",
   "restore_limit":"5",
   "backup_used":14,
   "restore_used":0,
   "service_period":{
      "start":"01-10-2019",
      "end":"31-10-2019"
   },
   "done": {
        "msg": "The VPS backup deletion process has been started. Please allow a few minutes for it to complete. You will recieve a notification email when its is completed."
    }
   }
}
   
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list