• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

man/H14-Oct-2014-1,1661,152

samples/H14-Oct-2014-6647

AUTHORSH A D06-Dec-2004592 1611

COPYINGH A D20-Mar-200911 KiB211167

ChangeLogH A D13-Oct-201422 KiB943512

CimCurl.cppH A D03-May-202210.8 KiB375264

CimCurl.hH A D12-Dec-20081.5 KiB6227

CimWinHttp.cppH A D12-Dec-200811.4 KiB482340

CimWinHttp.hH A D12-Dec-20081.7 KiB6429

CimXml.cppH A D13-Oct-2014121.3 KiB4,4723,685

CimXml.hH A D03-May-202226.8 KiB941808

CimXml.iH A D07-Aug-200816.7 KiB727607

CimXml.pyH A D04-Aug-2003112.1 KiB2,1612,006

CimXml_wrap.cppH A D14-Oct-2004916.6 KiB25,11022,443

Cimghttp.cppH A D12-Dec-20083.8 KiB12676

Cimghttp.hH A D12-Dec-20081.4 KiB4819

Cimwww.cppH A D12-Dec-20085.2 KiB187131

Cimwww.hH A D12-Dec-20081.5 KiB5626

INSTALLH A D03-Feb-201215.4 KiB371288

Makefile.amH A D21-Nov-20053.8 KiB11598

Makefile.inH A D14-Oct-201445.1 KiB996878

NEWSH A D13-Oct-20144.5 KiB149116

READMEH A D05-Jun-20073.4 KiB11490

README.pycliH A D07-Aug-20087 KiB153127

SunSMC.cppH A D07-Aug-20081.9 KiB6125

aclocal.m4H A D14-Oct-201434.5 KiB984881

cimcli.pyH A D07-Aug-20083.6 KiB11193

config.guessH A D03-Feb-201243.6 KiB1,5231,311

config.h.inH A D14-Oct-20143.6 KiB13996

config.subH A D03-Feb-201234.5 KiB1,7671,621

configureH A D14-Oct-2014196.6 KiB6,9575,729

configure.acH A D14-Oct-20144.1 KiB150129

depcompH A D03-Feb-201219.9 KiB689448

install-shH A D03-Feb-201213.7 KiB528351

main.cppH A D19-Sep-201320.8 KiB658531

missingH A D03-Feb-201210.1 KiB332243

sblim-wbemcli.specH A D14-Oct-20141.5 KiB6242

sblim-wbemcli.spec.inH A D07-Aug-20081.5 KiB6247

wbemcli.indH A D14-Apr-200366 32

README

1README
2
3Welcome to the wbemcli command line tool to access
4data hosted by a CIMOM .
5
6Please use the man page for further information .
7man wbemcli
8
9Available Command Aliases :
10
11wbemgi		GetInstance
12wbemein 	EnumInstanceNames
13wbemei		EnumInstances
14
15wbemci		CreateInstance
16wbemmi		ModifyInstance
17wbemdi		DeleteInstance
18
19wbemgc		GetClass
20wbemgcd		GetClass
21wbemdc		DeleteClass
22wbemec		EnumClasses
23wbemecn		EnumClassNames
24
25wbemai		Associators
26wbemain		AssociatorNames
27wbemri		References
28wbemrin		ReferenceNames
29
30wbemgp		GetProperty
31wbemsp		SetProperty
32
33wbemcm		InvokeMethod
34wbemcmx		InvokeMethod
35
36Usage :
37
38wbemcli gc|gcd|dc|ec|ecn|gi|ci|mi|di|ei|ein|ain|ai|rin|ri|gp|sp
39	        [-nl] [-dx] [-t] [-h] [-v]
40	        [-ac <assocClass>] [-arc <resultClass>] [-ar <role>] [-arr <resultRole>]
41	        <url> [<attrs>]
42	gc	get class
43	gcd	get class definition
44	dc	delete class
45	ec	enumerate class
46	ecn	enumerate class names
47	ci	create instance
48	mi	modify instance
49	di	delete instance
50	ec	enumerate instances
51	ecn	enumerate instance names
52	ain	associate instance names
53	ai	associate instances
54	rin	reference instance names
55	ri	reference instances
56	gp	get property
57	sp	set property
58	cm	call method
59	cmx     call method (returns XML)
60
61	-nl	one attribute per line
62	-dx	xml debugging
63	-t	add array([]) and ref(&) indications
64	-h	help
65	-v	version
66
67	-ac	 association class name (ai, ain only)
68	-arc	 result class name (ai, ain, rin, ri only)
69	-ar	 role name (ai, ain, rin, ri only)
70	-arr	 result role name (ai, ain only)
71
72	url	'<protocol>://[user:password@]<host>[:<port>]/<namespace[/..]>:<classname>[.<key=value[,..]>]'
73	attrs	'<name=value[,..]>' (required for ci and mi only)
74
75	Single quotes should be used around the url and attrs to perserve double
76	qouted strings. If not enclosed the double quotes will be striped by the
77	shell, and wbemcli will mistake string values starting with a digit/+/- as
78	numeric, or strings starting with 'true/false' as boolean.
79		example 'http://localhost:5988/root/cimv2:rpm_package.name="glibc",id=5'
80
81	Host indirection support: The string '<protocol>://[user:password@]<host>[:<port>]'
82	can be replaced by an arbitrary string. This string will be used to
83	locate the proper protocol and host specification in ./wbemcli.ind or
84	any file specified via the WBEMCLI_IND environment variable.
85	Format in ./wbemcli.ind is:
86		<string>: <protocol>://[user:password@]<host>[:<port>]
87
88BUILD Notes:
89
90See the INSTALL file. If checking out of CVS first run autoconfiscate.sh to
91setup the autotools.
92
93SSL Notes:
94
95Currently SSL (https) support is only working with libcurl. wbemcli supports
96both verification of the server and client certificate authentication.
97For server verification it is necessary to have access to a self signed
98certificate of the server or a CA certificate of the CA that issued the
99server's certificate in PEM format.
100There's no default location for this certificate: it must be specified with
101the -cacert option.
102The server certificate verification can be disabled with the -noverify option.
103If the server requires a client certificate, it can be specified with
104-clientcert in which case it is also necessary to specify the client's
105private key file with -clientkey. Both files must be in PEM format.
106
107BUGS:
108
109Authentication with libghttp is broken: incorrect user/password will cause a
110hang situation.
111
112Authentication with libwww is slightly broken: incorrect user/password will
113cause a meaningless error code.
114

README.pycli

1/*
2 * $Id: README.pycli,v 1.3 2008/08/07 18:25:41 tyreld Exp $
3 *
4 * README.pycli
5 *
6 * (C) Copyright IBM Corp. 2002, 2008
7 *
8 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
9 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
10 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
11 *
12 * You can obtain a current copy of the Eclipse Public License from
13 * http://www.opensource.org/licenses/eclipse-1.0.php
14 *
15 * Author:       David Eger <dteger@us.ibm.com>, <eger@cc.gatech.edu>
16 * Contributors:
17 *
18 * Description: Python bindings for WBEMCLI
19 */
20
21
22The WBEMCLI Python Bindings
23===========================
24
25In addition to the 'wbemcli' command line tool, this package includes
26python bindings for accessing CIMOMs such as SNIA-CIMOM or OpenPegasus.
27If you do not use Python, you can safely ignore this.
28
29Files included:
30+ CimXml.py  - the low-level C++/Python interface
31+ cimcli.py  - some utility functions to make using CimXml easier.
32
33To compile the Python bindings, type:
34
35$ make clipy
36
37
38Using Python to talk to your CIMOMs
39===================================
40
41After this, you can run Python scripts which access CIMOMs, or use
42Python as an interactive shell for talking to CIMOMs.
43
44In Python,
45comments begin with a hash mark (#).  The Python prompt is '>>>',
46or when continuing from a previous line '...'.  Python code is block
47structured by white space.  Further, you can continue the current line
48by putting a slash at the end of your line.
49
50Below is a sample of how you can use Python as a shell interface to
51your CIMOMs:
52
53# BEGIN SAMPLE INTERACTION
54
55$ python
56Python 2.2.3+ (#1, Jul  6 2003, 23:35:56)
57[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
58Type "help", "copyright", "credits" or "license" for more information.
59>>> execfile("cimcli.py")     # import utility functions
60>>> machines = getCIMOMs("192.168.64.8","24","PING")
61Portscanning port 5988 on subnet 192.168.64.8/24 for prospective CIMOMs
62IPs found:  ['192.168.64.8', '192.168.64.207']
63>>> setmachine("192.168.64.207", locals())    #
64>>>  # tell the CLI which machine we want to talk to
65>>> FSs = ei("CIM_FileSystem")                #
66>>>  # get a list of the filesystems on the box
67>>> len(FSs)  # how many did we get?
684
69>>> for i in FSs.ia:  # for each filesystem instance... (ia = instance array)
70...    print i
71...
72CreationClassName="Linux_Ext3FileSystem",Caption="Ext3 local file system",CSCreationClassName="Linux_ComputerSystem",CSName="dyn324513pok.pok.ibm.com",Name="/dev/sda1",Root="/boot",FileSystemType="ext3",Status="OK",Description="Represents the file store controlled by a ComputerSystem through local means.",ReadOnly=FALSE,BlockSize=1024,FileSystemSize=103515136,AvailableSpace=82735104,MaxFileNameLength=255,PercentageSpaceUse=14,ElementName="/boot",EnabledStatus=2,OtherEnabledStatus="NULL",RequestedStatus=2,EnabledDefault=3
73CreationClassName="Linux_Ext3FileSystem",Caption="Ext3 local file system",CSCreationClassName="Linux_ComputerSystem",CSName="dyn324513pok.pok.ibm.com",Name="/dev/sda2",Root="/home",FileSystemType="ext3",Status="OK",Description="Represents the file store controlled by a ComputerSystem through local means.",ReadOnly=FALSE,BlockSize=4096,FileSystemSize=7270162432,AvailableSpace=6450884608,MaxFileNameLength=255,PercentageSpaceUse=6,ElementName="/home",EnabledStatus=2,OtherEnabledStatus="NULL",RequestedStatus=2,EnabledDefault=3
74CreationClassName="Linux_Ext3FileSystem",Caption="Ext3 local file system",CSCreationClassName="Linux_ComputerSystem",CSName="dyn324513pok.pok.ibm.com",Name="/dev/sdb1",Root="/usr",FileSystemType="ext3",Status="OK",Description="Represents the file store controlled by a ComputerSystem through local means.",ReadOnly=FALSE,BlockSize=4096,FileSystemSize=8427929600,AvailableSpace=6655352832,MaxFileNameLength=255,PercentageSpaceUse=15,ElementName="/usr",EnabledStatus=2,OtherEnabledStatus="NULL",RequestedStatus=2,EnabledDefault=3
75CreationClassName="Linux_Ext3FileSystem",Caption="Ext3 local file system",CSCreationClassName="Linux_ComputerSystem",CSName="dyn324513pok.pok.ibm.com",Name="/dev/sda5",Root="/var",FileSystemType="ext3",Status="OK",Description="Represents the file store controlled by a ComputerSystem through local means.",ReadOnly=FALSE,BlockSize=4096,FileSystemSize=1052434432,AvailableSpace=949731328,MaxFileNameLength=255,PercentageSpaceUse=4,ElementName="/var",EnabledStatus=2,OtherEnabledStatus="NULL",RequestedStatus=2,EnabledDefault=3
76>>> for i in FSs.ia:  # that was too much information, let's do it different now.
77...    fsprops = i.getProperties()
78...    print "Filesystem on %s is %d%% full" % \
79...       (fsprops["ElementName"], \
80...        100 - 100 * long(fsprops["AvailableSpace"]) / long(fsprops["FileSystemSize"]))
81...
82Filesystem on /boot is 21% full
83Filesystem on /home is 12% full
84Filesystem on /usr is 22% full
85Filesystem on /var is 10% full
86>>>
87
88# END SAMPLE INTERACTION
89
90
91How it works
92============
93By using the Python Client, you're getting direct access to the
94C++ objects described by CimXml.h.  If, instead of saying "print" above,
95we had just typed the name of an object, our interaction would look like
96this:
97
98>>> execfile("cimcli.py")
99>>> setmachine("localhost",locals())
100>>> FSs = ei("CIM_FileSystem")
101>>> FSs
102<C NamedInstancesXml instance at _1015b4b0_p_NamedInstancesXml>
103
104This is the raw C++ object (actually, a raw pointer to a C++ object) of type
105NamedInstancesXml.  If you look in CimXml.h, you'll see a description like:
106
107/* from CimXml.h */
108
109class NamedInstancesXml : public RetValXml {
110  public:
111   InstanceArray ia;
112   InstanceNameArray ina;
113   NamedInstancesXml(NamedInstanceXml *n);
114   NamedInstancesXml * clone() { return new NamedInstancesXml(*this);}
115   void add(NamedInstanceXml& n);
116   InstanceNameXml& getName(int n)  { return ina.at(n); }
117   InstanceXml& getInst(int n)  { return ia.at(n); }
118   int size()                   { return ina.size(); }
119};
120
121Python doesn't need to know all of these details, just some.  We
122use a program called SWIG to automatically generate wrapper code so
123our Python code can talk to our C++ code.  We tell SWIG what wrappers
124to generate with a SWIG interface file called "CimXml.i".  In that file,
125we find the description:
126
127/* from CimXml.i */
128
129extern
130class NamedInstancesXml : public RetValXml {
131  public:
132   InstanceArray ia;
133   InstanceNameArray ina;
134   NamedInstancesXml(NamedInstanceXml *n);
135   void add(NamedInstanceXml& n);
136   InstanceNameXml& getName(int n);
137   InstanceXml& getInst(int n);
138%rename(__len__) size;
139   int size();
140};
141
142We've included the output of SWIG - CimXml.py and CimXml_wrap.cxx, so
143unless you change the interface file, you don't need to have SWIG.
144
145For each piece of code in the interface file, SWIG makes the glue so
146that handling objects and calling member functions between one OO language
147and another "just works."  If your object has a method called add(), and you
148tell SWIG this, then you can call object.add() from your Python code just
149as you would from C++.  Sometimes, however, you need to give SWIG some hints.
150Calling len() on a Python array is a natural way to get the array's length.
151Since our C++ code has a different name for this, we use the SWIG directive
152%rename().
153