Currently Being Moderated

Getting Started with Web Services API using Python - a Step by Step Guide

This guide is a detailed narrative of steps the author followed to get started with CIM Web Services v4 on a new Windows 7 64 bit machine, using Coverity Integrity Manager (CIM) version 5.5.3. The steps for other versions may be slightly different. Sample scripts for earlier versions may not work with v4. However, the latest CIM version bundles v4 and all previous versions. You can use sample scripts from any WS version with the latest CIM version.

  1. Download and install Python 2.7.2 from For example, I installed on my Windows machine at: C:\Python27\.
  2. Add the Python installation and scripts directories to your system PATH. For example, add this: C:\Python27\;C:\Python27\Scripts;
  3. Download and install setuptools from I installed setuptools-0.6c11.win32-py2.7.exe. This may not be necessary, but it's mentioned in Asya's previous instructions 5.3 Python: Administration, Configuration, Defect and WebServices Classes.
  4. Download and install Suds 0.4 from Extract files from suds-0.4.tar.gz, then execute: python install
  5. Download Coverity WS base classes for v4/Integrity Manager 5.5, all into the same directory. See Python base classes for v4/Integrity Manager 5.5 web services sample scripts.
    • Downloaded ConfigService.py_5.txt, DefectService.py_1.txt, and WebService.py_6.txt into C:\ws-scripts\ws-v4.
    • Renamed the files to
  6. Start CIM. Make sure you can access it through a web browser.
  7. When you run the Python scripts, you have three ways to provide your CIM access information.
    • On the command line you can use options.
      • For example: --host localhost --port 8080 --user admin --password coverity
      • or:  -H localhost -p 8080 -u admin -w coverity
    • On the command line you can provide a response file, then put the other options in the file.
      • For example: --response filename
      • or: -r filename
    • In the script you can modify the option defaults. See the set_defaults statements in the get_common_opts(self) function.
  8. Download and test sample scripts.


  1. Intro to Web Services API with python examples explains the basics.
  2. Python base classes for v4/Integrity Manager 5.5 web services sample scripts - Python classes that must be in place before running the sample scripts.
  3. Python WS script to print defect details, including source code, v4 - An example that accesses defect information.
  4. Python script to print all users belonging to specific group (v4) - An example that accesses administrative information.
  5. For more web services examples in Python, enter the following in the Search field in the upper right corner of any Coverity Connect page.
    • subject:python example
  6. Examples of local links to web services in a running CIM 5.5.3 instance on port 8080.


Delete Document

Are you sure you want to delete this document?