Backup a Citrix NetScaler using (NITRO) REST API


In this post we'll learn how to use Citrix NetScaler (NITRO) REST API, retrieve it and delete it.

Dealing with NITRO API

NITRO API documetnations is located on each NetScaler instance under download -> NITRO API Documentation.

Let’s create a backup:

client$ curl -s -k -X POST -H 'Content-Type:application/' --basic --user nsroot:password -d '{"systembackup":{"filename":"daily_backup","level":"basic"}}' ''

Let’s monitor the job until it’s completed:

client$ curl -s -k -X GET -H 'Content-Type:application/' --basic --user nsroot:password "" | python -m json.tool
    "errorcode": 0,
    "message": "Done",
    "severity": "NONE",
    "systembackup": [
            "createdby": "nsroot",
            "creationtime": "Fri Jun  3 09:28:49 2016",
            "filename": "daily_backup.tgz",
            "ipaddress": "",
            "level": "basic",
            "size": 21,
            "version": "NS10.5-61.11"

Let’s the remote file into a local folder:

client$ scp .

Finally remove the backup:

client$ curl -s -k -X DELETE -H 'Content-Type:application/' --basic --user nsroot:password "" | python -m json.tool
    "errorcode": 0,
    "message": "Done",
    "severity": "NONE"
Posted on 03 Jun 2016 by Andrea.
  • Gmail icon
  • Twitter icon
  • Facebook icon
  • LinkedIN icon
  • Google+ icon