Backup administration functions

getFileBackupList

Description:

Method returns available list of file backups.

Call example:

https://api.beget.com/api/backup/getFileBackupList?login=userlogin&
passwd=password&output_format=json

Response example:

  [
    {
        "backup_id": 14508595,
        "date": "2014-11-05 01:05:09"
    },
    {
        "backup_id": 14216570,
        "date": "2014-10-31 03:13:49"
    },
    {
        "backup_id": 14132477,
        "date": "2014-10-30 00:56:25"
    },
    {
        "backup_id": 14077266,
        "date": "2014-10-28 01:33:42"
    },
    {
        "backup_id": 14009305,
        "date": "2014-10-26 01:38:26"
    },
    {
        "backup_id": 13574406,
        "date": "2014-10-16 06:13:29"
    }
  ]

getMysqlBackupList

Description:

Method returns available list of mysql database backups

Call example:

https://api.beget.com/api/backup/getMysqlBackupList?login=userlogin&
passwd=password&output_format=json

Response example:

  [
    {
        "backup_id": 14508571,
        "date": "2014-11-05 01:04:16"
    },
    {
        "backup_id": 14216543,
        "date": "2014-10-31 03:12:44"
    },
    {
        "backup_id": 14132466,
        "date": "2014-10-30 00:55:43"
    },
    {
        "backup_id": 14077252,
        "date": "2014-10-28 01:31:53"
    },
    {
        "backup_id": 14009290,
        "date": "2014-10-26 01:28:59"
    },
    {
        "backup_id": 13713103,
        "date": "2014-10-19 05:11:13"
    },
    {
        "backup_id": 13574391,
        "date": "2014-10-16 05:59:31"
    }
  ]

getFileList

Description:

Method returns a list of files and directories from a backup according to the given path and identifier.

Additional parameters

  • backup_id - if backup_id is not given, the listing is performed according to the current copy;
  • path - path from home directory root (e.g. "/site.de/public_html");

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/getFileList?login=userlogin&passwd=password&
output_format=json&input_format=json&input_data={"path":"/site.de/public_html","backup_id":14508595}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/getFileList?login=userlogin&
passwd=password&input_format=json&output_format=json&
input_data=%7B%22path%22%3A%22%2Fsite.de%2Fpublic_html%22%2C%22backup_id%22%3A14508595%7D

Response example:

 [
    {
        "name": ".cache",
        "is_dir": 1,
        "mtime": "2012-12-25 18:35:05",
        "size": 4096
    },
    {
        "name": ".ssh",
        "is_dir": 1,
        "mtime": "2014-08-06 13:59:14",
        "size": 4096
    },
    {
        "name": "ftputil",
        "is_dir": 1,
        "mtime": "2014-08-07 13:06:09",
        "size": 4096
    {
        "name": "testlogo.png",
        "is_dir": 0,
        "mtime": "2013-02-13 11:02:13",
        "size": 18623
    },
    {
        "name": "textarea.js",
        "is_dir": 0,
        "mtime": "2013-04-05 18:14:18",
        "size": 1321
    },
    {
        "name": "tree-bottom.png",
        "is_dir": 0,
        "mtime": "2013-04-05 18:14:18",
        "size": 976
    },
    {
        "name": "update.php",
        "is_dir": 0,
        "mtime": "2014-01-16 15:56:36",
        "size": 25457
    }
 ]

Returns object array, each object consists of the following elements:

  • name - name of file or folder;
  • is_dir - property of file (0) or folder (1);
  • mtime - file creation time in format "Y-m-d H:i:s";
  • size - size in bytes;

getMysqlList

Description:

Method returns a list of databases from backup respective given identifier.

Additional parameters

  • backup_id - backup identifier backup_id, if not given, the listing is performed from current copy;

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/getMysqlList?login=userlogin&
passwd=password&input_format=json&output_format=json&
input_data={"backup_id":14216543}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/getMysqlList?login=userlogin&
passwd=password&input_format=json&output_format=json&
input_data=%7B%22backup_id%22%3A14216543%7D

Response example:

 [
    "db_test111",
    "db_test",
    "db_opca2",
    "db_btrx"
 ]

Returns list of database names.

restoreFile

Description:

Method creates query for data restoring from backup according to given path and backup copy.

Additional parameters

  • backup_id - backup copy identifier backup_id
  • paths - array (one or several values) of paths for restoring from home directory root (e.g. "/site.de/public_html");

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/restoreFile?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
{"backup_id":14508595,"paths":["/site.de/public_html/","/site2.de/public_html/"]}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/restoreFile?login=userlogin&
passwd=password&input_format=json&output_format=json&
input_data=%7B%22backup_id%22%3A14508595%2C%22paths%22%3A%5B%22%2Fsite.de
%2Fpublic_html%2F%22%2C%22%2Fsite2.de%2Fpublic_html%2F%22%5D%7D

Response example:

true

Returns property of successful or unsuccessful execution.

restoreMysql

Description:

Method creates query for DB recovery from backup according to given DB name and backup identifier.

Additional parameters

  • backup_id - backup identifier backup_id
  • bases - array (one or several values) of MySQL databases for recovery

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/restoreMysql?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
{"backup_id":"14132466","bases":["db_test","db_test2"]}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/restoreMysql?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
%7B%22backup_id%22%3A%2214132466%22%2C%22bases%22%3A%5B%22db_test%22%2C%22db_test2%22%5D%7D

Response example:

true

Returns property of successful or unsuccessful execution.

downloadFile

Description:

Method creates query for up- and downloading data from backup to account root.

Additional parameters

  • backup_id - backup identifier backup_id (optional), if not given, current copy will be used
  • paths - array (one or several values) of paths for recovery from home directory root (e.g. "/site.de/public_html");

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/downloadFile?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
{"backup_id":14508595,"paths":["/site.de/public_html/","/site2.de/public_html/"]}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/downloadFile?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
%7B%22backup_id%22%3A14508595%2C%22paths%22%3A%5B%22%2Fsite.de%2Fpublic_html
%2F%22%2C%22%2Fsite2.de%2Fpublic_html%2F%22%5D%7D

Response example:

true

Returns property of successful or unsuccessful execution.

downloadMysql

Description:

Method creates query for up- and downloading of data from backup to account root.

Additional parameters

  • backup_id - backup identifier backup_id (optional), if not given, current copy will be used
  • bases - array (one or several values) of MySQL database names for recovery

Call example:

// for illustration purposes input_data is presented in uncoded form
https://api.beget.com/api/backup/downloadMysql?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
{"backup_id":14216543,"bases":["db_test", "db_test2"]}

// correct call example, input_data is coded with urlencode
https://api.beget.com/api/backup/downloadMysql?login=userlogin&
passwd=password&input_format=json&output_format=json&input_data=
%7B%22backup_id%22%3A14216543%2C%22bases%22%3A%5B%22db_test%22%2C+%22db_test2%22%5D%7D

Response example:

true

Returns property of successful or unsuccessful execution.

getLog

Description:

Method returns list and statuses of tasks for recovery and downloading..

Call example:

https://api.beget.com/api/backup/getLog?login=userlogin&passwd=password&output_format=json

Response example:

 [
    {
        "id": 80240,
        "operation": "download",
        "type": "download_mysql",
        "date_create": "2014-11-05 14:22:13",
        "target_list": [
            "db_opca2"
        ],
        "status": "success"
    },
    {
        "id": 80239,
        "operation": "download",
        "type": "download_file",
        "date_create": "2014-11-05 14:17:11",
        "target_list": [
            "/site.de/public_html",
            "/site2.de/public_html"
        ],
        "status": "success"
    },
    {
        "id": 32904,
        "operation": "restore",
        "type": "restore_mysql",
        "date_create": "2014-11-05 14:00:44",
        "target_list": [
            "db_test",
            "db_opca2"
        ],
        "status": "success"
    },
    {
        "id": 32901,
        "operation": "restore",
        "type": "restore_file",
        "date_create": "2014-11-05 13:55:20",
        "target_list": [
            "/site.de/public_html",
            "/site2.de/public_html"
        ],
        "status": "success"
    },
    {
        "id": 13457,
        "operation": "restore",
        "type": "restore_file",
        "date_create": "2014-06-23 17:18:21",
        "target_list": [
            "/site.de/public_html",
            "/site2.de/public_html"
        ],
        "status": "success"
    }
 ]

Returns object array, each object consists of the following elements:

  • id - dosnload / restore query identifier;
  • operation - restore operation (restore), download (download);
  • type - detailed operation and restore / download data type and file / mysql;
  • date_create - query creation time in "Y-m-d H:i:s" format;
  • target_list - element array in query (files or databases);
  • status - execution status;

Tags: