Backup APIs
Learn how to obtain, edit, and disable backup schedules.
Before you begin
Before you proceed, ensure that the nz command line is installed.
Backup schedule
- Obtaining the current schedule
Set the environment variables so that you can access the REST end points.
NZ_USERandNZ_PASSWORDrefer to your username password.NZ_HOSTrefers to the hostname .
Output:export NZ_USER=.. NZ_PASSWORD=.. NZ_HOST=.. curl -k -X GET "https://${NZ_HOST}/v1/backup/creds" -d "{ \"user_name\":\"$NZ_USER\", \"token\":\"$NZ_PASSWORD\" } " -H 'Content-Type: application/json'{ "time": "02:30", # take backup 2:30 AM daily "enabled": true, # scheduled backups are enable "retention": 7, # last 7 backups are retained "message": "" }If you already set up
NZ_USER=..,NZ_PASSWORD=..,NZ_HOST=.., and want to run backup operations by using different credentials, you can pass them directly in the curl command.If the schedule wasn't enabled, the
Enabledoption is set tofalse. You can ignore the other values.You can't change the retention option. It's set to 7 by default. For example, seven stands for one full backup and six incremental backups.
- Editing the current schedule
-
To edit the schedule to 1:30 AM, set the environment variables to be able to access the REST end points.
NZ_USERandNZ_PASSWORDrefer to your username password.NZ_HOSTrefers to the hostname.
Output:export NZ_USER=.. NZ_PASSWORD=.. NZ_HOST=.. curl -k -X PUT "https://${NZ_HOST}/v1/backup/creds" -d "{ \"user_name\":\"$NZ_USER\", \"token\": \"$NZ_PASSWORD\", \"time\":\"01:30\", \"enabled\":true }" -H 'Content-Type: application/json'{"message": "Schedule updated successfully."}If you already set up
NZ_USER=..,NZ_PASSWORD=..,NZ_HOST=.., and want to run backup operations by using different credentials, you can pass them directly in the curl command. - Dialing the current schedule
-
To disable the schedule, set the environment variables to be able to access the REST end points.
NZ_USERandNZ_PASSWORDrefer to your username password.NZ_HOSTrefers to the hostname .curl -k -X DELETE "https://${NZ_HOST}/v1/backup/schedule" -d "{ \"user_name\":\"$NZ_USER\", \"token\": \"$NZ_PASSWORD\" }" -H 'Content-Type: application/json'Output:{"message": "Schedule disabled successfully."}