Add days paramater to generate_backup method (#232)

This commit is contained in:
Jacob Timmerman 2024-08-02 17:12:29 +02:00 committed by GitHub
parent 108ddd3995
commit fdea77fce0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1557,11 +1557,12 @@ class Client
* Generate a backup * Generate a backup
* *
* @note this is an experimental function, please do not use unless you know exactly what you're doing * @note this is an experimental function, please do not use unless you know exactly what you're doing
* @param int $days number of days for which the backup must be generated
* @return array|bool URL from where the backup file can be downloaded once generated, false upon failure * @return array|bool URL from where the backup file can be downloaded once generated, false upon failure
*/ */
public function generate_backup() public function generate_backup(int $days = -1)
{ {
$payload = ['cmd' => 'backup']; $payload = ['cmd' => 'backup', 'days' => $days];
return $this->fetch_results('/api/s/' . $this->site . '/cmd/backup', $payload); return $this->fetch_results('/api/s/' . $this->site . '/cmd/backup', $payload);
} }