• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Question CLI API

zooloo

New Pleskian
Server operating system version
AlmaLinux 9.3
Plesk version and microupdate number
Version 18.0.60 Update #1, last updated on April 25, 2024 03:15 AM
Good afternoon
Please tell me the correct JSON example for recovery via api cli

how to specify the correct path and command?

-d '{"params": [
"--get","clients"],"env": {"in": "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml"}}'

thx
 
The CLI method for the Rest API is based on the Plesk CLI. The documentation for the pleskrestore CLI utility can be found here and lists all commands and options.

You can try this payload body for example:
Code:
{
  "params": [
    "--restore",
    "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml",
    "-level",
    "clients"
  ]
}

Or if you have secured the backups with a password you can specify the password using the PLESK_BACKUP_PASSWORD environment variable. For example:
Code:
{
  "params": [
    "--restore",
    "/var/lib/psa/dumps/clients/uesrname/backup_info_2404200000_2404250000.xml",
    "-level",
    "clients"
  ],
  "env": {
    "PLESK_BACKUP_PASSWORD": "<password goed here>"
  }
}
 
Last edited:
Thx
Is there a comma before level?

Another question is how to get a list of backups for customers
 
Another question is how to get a list of backups for customers
Good one. I don't think there is an method available to list backups. Best I can think of to create your own script which reads trough the /var/lib/psa/dumps/clients/uesrname/ directory and looks for XML files.
 
Back
Top