Main Content

polyspace-access -download

Download results from Polyspace Access

    Description

    The system command polyspace-access -download downloads results from a Polyspace® Access™ project to a local folder.

    polyspace-access -download <resultsToDownload> -output-folder-path <outputFolderPath> -host <hostname> [login options] [output options] downloads results from Polyspace Access project <resultsToDownload> to a folder whose location you specify with <outputFolderPath>. You specify the project using either the full path in Polyspace Access or the run ID.

    Use this command as part of the workflow to merge review information between projects, or to create a baseline for subsequent Polyspace analyses.

    Note that if you download static analysis results, you cannot open the downloaded results in the Polyspace desktop interface or the Polyspace as You Code IDE extensions.

    To get the paths to projects and their most recent run IDs, use the polyspace-access -list-projects command.

    example

    Examples

    collapse all

    Download the results of a particular project run to use as a baseline for subsequent Polyspace analyses.

    Identify the result you want to download from Polyspace Access to use as the baseline. List all the runs from the project public/Examples/Bug Finder Example by using the polyspace-access -list-runs command and note the RUN_ID.

    polyspace-access -list-runs "public/Examples/Bug Finder Example" ^
    -host myAccessServer -port 1234
    
    login: kJohnson
    password:
    
    Connecting to myAccessServer:1234
    Connecting as kJohnson
    PROJECT_PATH "public/Examples/Bug Finder Example" RUN_ID 1758 LABELS "1.0"
    PROJECT_PATH "public/Examples/Bug Finder Example" RUN_ID 1759 LABELS "1.0"
    PROJECT_PATH "public/Examples/Bug Finder Example" RUN_ID 1760 LABELS "1.0" "Baseline"
    PROJECT_PATH "public/Examples/Bug Finder Example" RUN_ID 1761 LABELS "1.0"

    The project contains four runs, 1758, 1759, 1760, and 1761. Run 1760 has two labels, "1.0" and "Baseline".

    Download the results for the run with label "Baseline" by using its run ID, 1760. Use -output-folder-path to specify a folder to save your downloaded results.

    polyspace-access -download 1760 -output-folder-path C:\Polyspace_Workspace\baseline ^
    -host myAccessServer -port 1234 

    The results are downloaded and saved in C:\Polyspace_Workspace\baseline. You can now set these results as your baseline. See Set Baseline Polyspace as You Code Results on Command Line.

    Input Arguments

    collapse all

    Download Results

    Absolute path or run ID of the project results that you download, specified as a string. Polyspace assigns a unique run ID to each analysis run that you upload to Polyspace Access. If the path name includes spaces, use double quotes. To get the project results path or latest run ID, use polyspace-access -list-project.

    When you specify the project path, the command downloads the latest run of that project. To download an older run, specify the run ID. To obtain the run ID of older runs, in the Polyspace Access interface, select a project in the Project Explorer, and then click the Current drop-down selection in the toolstrip to view the available run IDs.

    Example: -download "public/Examples/Bug_Finder_Example (Bug Finder)"

    Example: -download 5113

    Path of the folder where you store the downloaded results, specified as a string. If the folder you specify already exists, it must be empty.

    Example: -output-folder-path C:\Polyspace_Workspace\baseline

    Connection Configuration

    Polyspace Access machine hostname that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which hostname to use, contact your Polyspace Access administrator.

    You must specify a hostname with all polyspace-access commands, except the -generate-migration-commands and -encrypt-password commands.

    Example: -host myAccessServer

    Port number that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which port number to use, contact your Polyspace Access administrator.

    HTTP protocol used to access Polyspace Access, specified as http or https.

    Full path to the text file where you store your login credentials. Use this option if you use a command that requires your Polyspace Access credentials in a script but you do not want to store your credentials in that script. While the script runs, someone inspecting currently running processes cannot see your credentials.

    You can store only one set of credentials in the file, either as -login and -encrypted-password entries on separate lines, for instance:

    -login jsmith
    -encrypted-password LAMMMEACDMKEFELKMNDCONEAPECEEKPL
    You can also store credentials as an -api-key entry:
    -api-key keyValue123
    Make sure that the file where you store your credentials is UTF-8 encoded and that you restrict the read and write permissions on the file. For example, to restrict read and write permissions on file login.txt in Linux®, use this command:
    chmod go-rwx login.txt

    API key you use as a login credential instead of providing your login and encrypted password. To assign an API key to a user, see Configure User Manager or contact your Polyspace Access administrator.

    Use the API key if you use a command that requires your Polyspace Access login credentials as part of an automation script with a CI tool such as Jenkins®. If a user updates their password, you do not need to update the API key associated with that user in your scripts.

    It is recommended that you store the API key in a text file and pass that file to the command by using the -credentials-file option.

    Login username that you use to interact with Polyspace Access.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use -api-key.

    Login password you use to interact with Polyspace Access. <ENCRYPTED_PASSWORD> is the output of the polyspace-access -encrypt-password command.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use the -api-key option.

    Number of times the polyspace-access command retries to upload results when you upload from a client machine to the server machine that hosts Polyspace Access before failing. Specify this option to retry the upload command in the event of sporadic network outages. The command waits 10 seconds between retries.

    Full path to command outputs.

    Path to the folder for storing temporary files generated by polyspace-access commands. The default folder path depends on your platform:

    • Windows — C:\Users\%username%\AppData\Local\Temp\ps_results_server

    • Linux — tmp/ps_results_server

    File path where you store the command output log. By default the command does not generate a log file.

    Version History

    Introduced in R2019a