Skip to main content

Using the CLI Tool to Download Saved Publications

Use the CLI tool to download saved publications located in the Varicent Incentives database.

You must extract the IBM Incentives Command Line Tool from the compressed folder that came with your release.

  1. Open the command prompt.

  2. Navigate to the directory where the import tool is stored.

  3. From the command-line, type this command:

    "IBM Incentives Command Line Tool.exe" --host "<ICM address>" --username "<ICM login name>"
    --password "<ICM login password>" --model "<name of model>" 
    --function "downloadpublication"  --filename "<file path>"

    where, filename is location that you want the publications to be saved to. If the filename already exists, it will be overwritten by the new downloaded file.

    You can use these optional parameters to change which types of publications are downloaded:

    Parameters

    Description

    limit

    The maximum number of files that you want to download. By default, all files are downloaded. This example would download the most recent publication by setting the limit to 1:

    "IBM Incentives Command Line Tool.exe" --host "https://spm.ibmcloud.com" --username user1@varicent.com --password "aStr0ngP@ssw0rd" --model "mymodel" --function "downloadpublication" --filename "C:\publish.zip" --limit 1 

    startdate

    Downloads all files published on this date and after. Must be in the format yyyy-mm-dd

    "IBM Incentives Command Line Tool.exe" --host "https://spm.ibmcloud.com" --username "user1@varicent.com" --password "aStr0ngP@ssw0rd" --model "mymodel" --function "downloadpublication" --filename "C:\publish.zip" --startdate "2016-07-26"

    starttime

    Downloads all files published at this time and after. Must be used with startdate parameter. Must be in the format hh:mm:ss.zzz

    "IBM Incentives Command Line Tool.exe" --host "https://spm.ibmcloud.com" --username "user1@varicent.com" --password "aStr0ngP@ssw0rd" --model "mymodel" --function "downloadpublication" --filename "C:\publish.zip" --startdate "2016-07-26" --starttime "14:54:33.934"

    prefix

    Downloads all files that start with this string. Prefixes are added when creating saved publications in the admin client. This example downloads the most recent publication with a filename starting with "calc1":

    "IBM Incentives Command Line Tool.exe" --host "https://spm.ibmcloud.com" --username "user1@varicent.com" --password "aStr0ngP@ssw0rd" --model "mymodel" --function "downloadpublication" --filename "C:\publish.zip" --limit 1 --prefix "calc1"

    sortasc

    Downloads oldest files first. By default, publications are sorted by most recent first. This example downloads the oldest saved publication by setting the limit to 1 and sorting in ascending order:

    "IBM Incentives Command Line Tool.exe" --host "https://spm.ibmcloud.com" --username "user1@varicent.com" --password "aStr0ngP@ssw0rd" --model "mymodel" --function "downloadpublication" --filename "C:\publish.zip" --limit 1 --sortasc

    Important

    Enclose the parameters with quotation marks "<name>" to prevent errors related to spaces in names.

    You must update your passwords in the command every time you update your admin client password.

If the tool runs successfully, it will return an exit code of 0. If it fails, the tool will return a non-zero exit code. If there was an error, you can rerun the download command again, and if the filename exists, it will replace it with new downloaded file.