Main Content

polyspace-access -set-deletion-policy

Set or edit project run deletion policy

    Description

    The system command polyspace-access -set-deletion-policy sets or edits the deletion policy for the specified project.

    polyspace-access -set-deletion-policy <projectPath> -max-days <MAX_DAYS> -host <hostname> [login options] [output options] sets or edits project run deletion policy for specified project. After you set the deletion policy, Polyspace® applies the policy on each subsequent upload to the project and deletes project runs from the database based on the max days threshold. <MAX_DAYS> is the number of days a run is kept in a project. If you upload a new run, and a previous run was uploaded more than <MAX_DAYS> ago, Polyspace deletes the run.

    You can set a deletion policy using both the <MAX_DAYS> and <MAX_RUNS> thresholds. When you specify both thresholds, Polyspace deletes a project run if that run exceeds either threshold. For more information on deletion policies, see Delete Project Runs or Entire Projects.

    example

    polyspace-access -set-deletion-policy <projectPath> -max-runs <MAX_RUNS> -host <hostname> [login options] [output options] sets or edits project run deletion policy for specified project. After you set the deletion policy, Polyspace applies the policy on each subsequent upload to the project and deletes project runs from the database based on the max runs threshold. <MAX_RUNS> is the number of runs in a project. If you upload a new run, and the project already contains <MAX_RUNS> runs, Polyspace deletes the oldest run in the project.

    You can set a deletion policy using both the <MAX_DAYS> and <MAX_RUNS> thresholds. When you specify both thresholds, Polyspace deletes a project run if that run exceeds either threshold. For more information on deletion policies, see Delete Project Runs or Entire Projects.

    Examples

    collapse all

    To optimize the performance of the Polyspace Access™ database, perform regular clean up operations such as the deletion of old or obsolete projects. Back up your database before you perform clean up operations.

    View the current deletion policy of the project public/example_BF.

    polyspace-access -get-deletion-policy public/example_BF -host example-access-server
    
    Connecting to https://example-access-server:9443
    Connecting as ytaro
    Current deletion policy: MAX_RUNS 10
    Command Completed

    You can define the deletion policy according to the maximum number of runs to keep in a project and the maximum number of days to keep runs in a project. In this case, the deletion policy is set to a maximum of 10 runs. If the project public/example_BF already contains 10 runs and you upload a new run, Polyspace deletes the oldest run in the project.

    Edit the new deletion policy for the project public/example_BF so that Polyspace deletes project runs older than 30 days by using the <projectPath> command.

    polyspace-access -set-delete-policy public/example_BF -max-days 30 -host example-access-server
    
    Connecting to https://example-access-server:9443
    Connecting as ytaro
    Current deletion policy: MAX_RUNS 10
    New deletion policy: MAX_DAYS 30
    Command Completed

    Polyspace now deletes a run in the project public/example_BF when the run is more than 30 days old. The previous maximum runs value has been removed and Polyspace uses only the value for the maximum number of days in the deletion policy. Polyspace applies this new deletion policy on each subsequent upload. If you do not upload additional runs to the project, Polyspace does not delete any runs, even if the runs meet the policy criteria for deletion.

    Remove the deletion policy from the project public/example_BF.

    polyspace-access -unset-delete-policy public/example_BF -host example-access-server
    
    Connecting to https://example-access-server:9443
    Connecting as jsmith
    Current deletion policy: MAX_DAYS 30
    New deletion policy: NONE
    Command Completed

    Input Arguments

    collapse all

    Manage and View Projects

    Absolute path of the project, specified as a string. If the path name includes spaces, use double quotes.

    Example: -set-deletion-policy public/Folder/projectName

    Example: "public/Folder/Project with spaces"

    Maximum age of a project run in days, specified as a positive integer. If you upload a new run, and a previous run was uploaded more than <MAX_DAYS> ago, Polyspace deletes the run from the database.

    The deletion policy is applied on each upload after you set the policy. Polyspace does not delete runs that are older than <MAX_DAYS> days until you upload a new run.

    Omit this option when setting a deletion policy to clear the max number of days value from the deletion policy of a project.

    Example: -max-days 30

    Maximum number of runs that you keep in a project, specified as a positive integer. If you upload a new run, and the project already contains <MAX_RUNS> runs, Polyspace deletes the oldest run in that project from the database. Polyspace does not count runs that you exclude from deletion when applying the deletion policy.

    Omit this option when setting a deletion policy to clear the max number of runs value from the deletion policy of a project.

    Example: -max-runs 10

    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