pyARS - from python to ARS

Tutorial for usage of pyars.ercmdb

pyars.erCMDB: introduction

Currently the pythonic layer erCMDB does not offer much functionality. Yet.

With GetClass you can get the definition of a class, handing over only the name of the class; ercmdb.GetClass will handle the rest for you:

from pyars import ercmdb
ars = ercmdb.erCMDB()
ars.Login('server:port', 'user', 'password')
className = '%s:%s' % (ccmdb.BMC_namespace, ccmdb.BMC_baseclass)
class = ars.GetClass(className)
if ars.errnr > 1:
# do some error handling
ars.logger.error('Could not retrieve class: %s' % className)
else:
print "The superclass of class %s:%s is %s:%s' % (
ccmdb.BMC_namespace,
ccmdb.BMC_baseclass,
class.superclassNameId.namespaceName,
class.superclassNameId.className)
ars.Logoff()