Table Of Contents

This Page

_images/btnDownload.png _images/btnDocs.png _images/btnChanges.png

pyARS - the swiss knife for the Remedy developer and admin

News

  • 2015-03-08: I would like to hand over maintenance of the pyARS module to a new maintainer. Please contact me, if you are interested.
  • 2015-03-08: This releases fixes two bugs – one with ARSetActiveLink, the other with the definitions for 8.0 and 8.1 (especially under Linux). Please see Changes for details!
  • 2014-07-18: This releases offers the first steps to a 8.0 and 8.1 compatibility; it can load the libraries, but does not offer any functionality improvements yet. Please see Changes for details!
  • 2012-12-10: Version 1.8.0 has been released with support for 64bit under Windows and Solaris (see Changes for details)
  • 2012-06-21: Version 1.7.2 has been released with minor bugfixes
  • 2012-03-30: Version 1.7.1 has been released with minor bugfixes
  • 2012-02-17: Version 1.7.0 has been released, featuring cygwin support, all remaining 7.6 functions implemented, more robust dll/lib finding and loading, especially with 64bit libs, better test coverage, many more client server combinations tested in my test environment
  • 2012-02-05: If you want to try pyARS under Linux, you can now find patches for many Python releases on the project site .
  • 2011-12-05: Version 1.6.0 has been released.
  • 2010-12-20: Version 1.5.0 comes with experimental Linux support. Please contact me if you are planning to use that as it currently requires patching the python interpreter.
  • ...
  • 2009-03-09: pyars now has a blog as well.

How do I get started?

  • python 2.4, 2.5, 2.6 or 2.7 (available from: the Python website; if you are using 2.4, you also need Thomas Heller’s excellent ctypes module, available from sourceforge)
  • If you want to use pyARS under Linux: you need to apply a patch to the standard python sources from the project site.
  • Have your Remedy shared libs/dlls ready; pyARS searches for them:
    1. on Windows: first in your PATH settings; if it doesn’t find them there, it will extend the search to the install directories of the user or admin tool.
    2. on cygwin: first in your PATH (just add the directory of the Windows dll files to the cygwin PATH): if it doesn’t find them there and you have installed the module cygwinreg, it will extend the search to the install directories of the user or admin tool.
    3. on Solaris: in your LD_LIBRARY_PATH
    4. on Linux: in your LD_LIBRARY_PATH
  • optional: if you want a decent python editor, you could download http://sourceforge.net/projects/pywin32/. I’m using Eclipse with a very good python extension.

Features of pyARS

The pyars python module allows developers to use the ARSystem (ARS) API functions as well as Atrium CMDB API functions to talk to and remote control any ARSystem or Atrium CMDB server, allowing e.g. for extremely quick prototyping, data corrections, integrations with other systems, etc.

  • remote control your ARSystem and Atrium CMDB

  • pyARS does not require compilation (easy to install and maintain)

  • use python’s interactive shell to interactively research and manipulate ARSystem data structures (forms, filters, activelinks, entries, etc.).

  • a wrapper object takes care of session handling and adapts itself to the ARSystem version available: the different API versions are automagically mapped to different wrapper classes that only expose the appropriate functions; a separate wrapper is available to support the CMDB (originally AROS) api and adapts itself to the CMDB version used.

  • all(!) data structures are available as python classes

  • memory management for Python objects is semi-automatic; the pythonic level pyars.erars tries to automate it as much as possible, including some caching. However, the lower level pyars.ars cannot handle the memory management. But with pyars, there is only one function to worry about: ARFree; just hand over any ARS data structure that you would like to be freed, and it will call the corresponding ARFree function(s).

  • Comfort structures: pyars.erARS defines a couple of its own structures, that bring together all detail information about the object in one single place: ARActiveLinkStruct, ARActiveLinkList, ARContainerStruct, AREscalationStruct, ARFilterStruct, ARMenuStruct, and others (see file details for details).

  • similarly to ARSPerl some convenience functions are provided: Login, Logoff, schemaExists and others. Login provides an additional feature: if you define the server name as “server:port” (as internet URLs usually do), you can define the port number for the communication. You can use an even tighter syntax: when creating a session instance, hand over the login information:

    ars = ARS('server:port', 'user', 'password')
    
  • supports detailed logging (to switch on, use:

    import logging
    ars.logger.setLevel(logging.DEBUG)
    (default is: INFO).
    
  • mapping dictionaries are provided (although not complete yet) that translate ARS constants to usable strings, e.g.:

    ars_const['AR_DATA_TYPE']= {
    AR_DATA_TYPE_NULL: 'NULL',
    AR_DATA_TYPE_KEYWORD: 'KEYWORD',
    AR_DATA_TYPE_INTEGER: 'INTEGER',
    AR_DATA_TYPE_REAL: 'REAL',
    ...}
    
  • pyARS offers two levels of access to both, standard ARSystem as well as BMC Atrium functionality: one is the low level C API access, the second is with a more pythonic approach, using standard Python data structures instead of C types.

  • supported plattforms: currently Windows, Solaris and cygwin. Linux support is experimental currently, and I have no access to AIX to test it there.

How can you contribute?

The following is a list of issues where you could lend a helping hand:

  • help me with maintaining the project, potentially taking over from me
  • send in success stories (e.g. migration from C, ARSperl...) and example code
  • try to get pyARS to run under AIX
  • enhance the test coverage
  • enhance documentation and doc strings
  • help implementing outstanding functions (CMDB and ARS)
  • ...