Backup APIs

Deployment options: Netezza Performance Server for Cloud Pak for Data

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

You can set the backup schedule to take a backup of all the databases one time every 24 hours.
Obtaining the current schedule

Set the environment variables so that you can access the REST end points.

NZ_USER and NZ_PASSWORD refer to your username password.

NZ_HOST refers to the hostname .

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'
Output:
{ "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 Enabled option is set to false. 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_USER and NZ_PASSWORD refer to your username password.

NZ_HOST refers to the hostname.

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'
Output:
{"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_USER and NZ_PASSWORD refer to your username password.

NZ_HOST refers 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."}