KwadminThe kwadmin command administers integration projects and builds. In order to use some of the following command options, you may need to have a specific permission level. See Enabling access to Klocwork projects for more information. Usagekwadmin [<common_options>] <subcommand> [<subcommand_options>] where
You can also specify an arguments file for kwadmin or for kwadmin subcommands: kwadmin @<arguments_file> kwadmin <subcommand> @<arguments_file> You can create an arguments file to specify your command line arguments. Each argument must be specified on a separate line. (If the arguments file contains multibyte characters, the file must be UTF-8 encoded.) Example kwadmin --url http://server01.acme.com:8080 list-projects Options that apply to all kwadmin subcommandsThe options in the table below apply to all of the subcommands. Subsequent sections provide information on kwadmin subcommands and the options that apply to each. These options are to be placed before the subcommand.
kwadmin create-projectUse kwadmin create-project to create a new project with the specified name. Note that the newly created project does not contain data until it is analyzed (built). kwadmin create-project <project_name> [options] where:
Note: To reference a project on the command line, you must specify the project using the correct case (since project names are case sensitive). You must also specify the exact, current name of the project as it appears in Klocwork Static Code Analysis.
Example kwadmin create-project Toolbus Options
kwadmin delete-buildUse this command to remove a project build from the builds list and the database. Note: Once deleted, this build data is unrecoverable.
kwadmin delete-build <project_name> <build_name> where:
Example kwadmin delete-build Toolbus build_9 kwadmin delete-configUse this command to remove a project-level or system configuration file. See kwadmin import-config for more information on managing configuration files. kwadmin delete-config <project_name> <config-file_name> where:
Examples kwadmin delete-config Toolbus metrics_custom.mconf kwadmin delete-config workspace OurMetrics.mconf kwadmin delete-projectUse this command to remove the specified project and all its builds from the projects list and the database. CAUTION: Once deleted, this project data is unrecoverable.
kwadmin delete-project <project_name> where
Example kwadmin delete-project Toolbus kwadmin duplicate-projectUse this command as a shortcut to creating a new project. It duplicates a project's settings, the views, modules, users and permissions associated with the project, pointers to source type locations, and configuration files. The builds of the original project are not duplicated. kwadmin duplicate-project <existing_project_name> <new_project_name> where:
Note: To reference a project on the command line, you must specify the project using the correct case (since project names are case sensitive). You must also specify the exact, current name of the project as it appears in Klocwork Static Code Analysis.
Example kwadmin duplicate-project Toolbus New_Toolbus If the .conf file of the project you want to duplicate contains manually configured properties or settings, you must restart that project's Klocwork server (or it must have been restarted after the changes were originally configured) in order to ensure that the properties and their values will be copied during the duplicate-project operation. kwadmin get-build-propertiesUse this command to display the properties of the specified project build. For a complete list of build properties, see Reference for integration project and build properties. To display the properties of a specific project build, type the following command: kwadmin [--url http(s)://<host>:<port>/] get-build-properties <project_name> <build_name> where
Example kwadmin get-build-properties Toolbus build_2 kwadmin get-project-propertiesUse this command to display the properties of the specified project. Some of these properties are editable. For a complete list of project properties, see Reference for integration project and build properties. To view the properties of an existing project, type the following command: kwadmin [--url http(s)://<host>:<port>/] get-project-properties <project_name> where
Example kwadmin get-project-properties Toolbus kwadmin get-projects-rootUse this command to display the current projects_root (that is, the projects_root on which the Klocwork Server was started). kwadmin get-projects-root Example kwadmin --url http://ServerXZY.acme.com:8080 get-projects-root kwadmin import-configUse kwadmin import-config to import configuration files into a single project or an entire projects_root. kwadmin import-config <project_name> <file> where:
Examples kwadmin import-config Toolbus C:\Klocwork\OurMetrics.mconf kwadmin import-config Toolbus C:\Klocwork\Toolbus_ownership.sow kwadmin import-config workspace C:\Klocwork\OurMetrics.mconf See Managing configuration files for integration projects for more information. kwadmin list-buildsUse this command to list the existing builds for the specified project. kwadmin list-builds <project_name> where:
Example kwadmin list-builds Toolbus kwadmin list-config-filesUse kwadmin list-config-files to list the configuration files used for the specified project. See also "Configuration files for Klocwork projects". kwadmin list-config-files <project_name> where:
Example kwadmin list-config-files Toolbus kwadmin list-config-typesUse kwadmin list-config-types to list the names and extensions of valid types of configuration files. See also Configuration files you can edit. kwadmin list-config-types Example kwadmin --url http://myhost.acme.com:8080 list-config-types kwadmin list-projectsUse this command to display a list of existing projects in the current projects_root directory. kwadmin list-projects Example kwadmin --url http://myserver.acme.com:8080 list-projects kwadmin loadUse this command to load the Klocwork tables generated by kwbuildproject to the Klocwork Server. kwadmin load <project_name> [<tables-directory>] where
Example kwadmin load Toolbus /my/tables/directory Options
kwadmin lock-project-versionUse this command when you want to load builds from an earlier version of Klocwork into a later version of the Klocwork Server. When you run this command on the build machine that is running the older version of Klocwork, the command creates a file that contains information about the engine and checker configuration on the build machine, including any custom checkers and whether checkers are enabled or disabled. The server uses this information as the base configuration for the project. kwadmin lock-project-version <project_name> --url http(s)://<host>:<port>/ where
Example kwadmin lock-project-version myproject --url http://my2018server.acme.com:8084 For more information, see Cross-version support for builds. kwadmin rename-buildUse this command to rename a build. kwadmin rename-build <project_name> <build_name> <new_build_name> where
Project and build names must start with a letter or a digit. Period (.), minus sign (-), ampersand (&), white space and the underscore character are also allowed in project and build names. Also note that each cannot be longer than 64 characters. Note: To reference a project on the command line, you must specify the project using the correct case (since project names are case sensitive). You must also specify the exact, current name of the project as it appears in Klocwork Static Code Analysis.
Note: When using white space, ampersand or a dot, wrap the name in double quotes.
Example kwadmin rename-build demosthenes buidl_6 build_6 kwadmin rename-projectUse this command to rename a project. kwadmin rename-project <project_name> <new_project_name> where
Project and build names must start with a letter or a digit. Period (.), minus sign (-), ampersand (&), white space and the underscore character are also allowed in project and build names. Also note that each cannot be longer than 64 characters. Note: To reference a project on the command line, you must specify the project using the correct case (since project names are case sensitive). You must also specify the exact, current name of the project as it appears in Klocwork Static Code Analysis.
Note: When using white space, ampersand or a dot, wrap the name in double quotes.
Example kwadmin rename-project demosthenes zlib kwadmin set-project-propertyUse this command to set the properties for an existing project. The change applies to all subsequent analysis runs. Prerequisite: all of the Klocwork Servers must be running. See Start the Klocwork Servers. kwadmin --url http(s)://<server>:<port> set-project-property <project_name> <property> <value> where
Example The following example shows how to change the default setting for issue grouping so that the system persistently shows server issues with grouping off. kwadmin --url http://myserver:8080/ set-project-property Toolbus grouping_on_default false Notes When adding a value to a property that consists of a comma-separated list of values, you must specify all of the existing values as well as the value you are adding (with no spaces between the values). Otherwise, the value you specify will overwrite the existing values. The values you specify are not validated by Klocwork, so it is possible to set a property value that will cause an analysis to fail. If you set an invalid option, you must unset the option by running the command again, specifying all of the current values for the property except for the invalid one. If any of the following conditions apply, enclose the entire property value in single quotation marks:
For more information, see Reference for integration project and build properties. kwadmin unlock-project-versionUse this command to undo the lock-project-version command, if you no longer want to use the checker configuration from an earlier version of Klocwork with your project. After you run this command, Klocwork uses the checker configuration for the Klocwork Server on which the build is loaded (which can be a different set of checkers from the analysis run on the build machine). kwadmin unlock-project-version <project_name> --url http(s)://<host>:<port>/ where
Example kwadmin unlock-project-version myproject --url http://my2018server.acme.com:8084 For more information, see Cross-version support for builds. Exit codes When you run the kwadmin command, the system generates one of two possible exit codes: if the command ran successfully and generated no errors, the exit code will be 0; the exit code will be 1 if
|