PowerCIM

Jump to: navigation, search

Introduction

powerCIM is a tool which makes (python) scripting in Common Information Model (i.e. writing CIM clients) as easy as possible. Currently its an experimental code which might be refactored.

In concept it is similar to other projects such as pywbem or rubywbem – python/ruby bindings for CIM/WBEM. What makes this project different is the focus on the ease of development. You should be able to develop CIM clients quickly and efficiently. It should be also possible to use powerCIM together with an interactive prompt as a powerfull system management console.

Unlike pywbem, powerCIM provides intuitive mapping from CIM classes to Python. For each CIM class you would like to use a respective Python class is compiled and you can use it as a regular class (e.g. in shell you can use Tab completion to auto-complete names of properties and/or methods).

powerCIM is also supposed to provide ways to debug your client code easily or generate a programmers documentation for CIM classes (using tools like pydoc or epydoc).

Download

RPMs

http://download.opensuse.org/repositories/home:/mmrazik/

Source Code

http://svn.opensuse.org/svn/powerCIM

Example

#!/usr/bin/env python
#
# Example application using powerCIM
#
# it connects to given host and stops all SSH services registered at this WBEM
# server 

import powerCIM

#host definition
host = 'king.suse.cz'
login = 
password = 
namespace = 'smash'

#create factory/connection
factory = powerCIM.WBEMFactory(host, login, password, namespace)

#get all SSH services at this server
instances = factory.EnumerateInstances('OMC_SSHProtocolService')

#for each sshd, print status and stop the daemon
for sshService in instances:
    print "SSH Started: "+ sshService.Started.__str__()
    sshService.StopService()
    assert sshService.Started == False