y: times new roman,new york,times,serif; font-size: 12pt;">
">
-weight: bold;">From: Paul Robert Marino <prmarino1-at-gmail.com=
>
To: hangout-at-mrbrk=
lyn.com
Sent: Friday,=
August 24, 2012 12:20 AM
Subject=
: [NYLXS - HANGOUT] Announcement Lib-CIM-Perl now published on G=
ithub
=0AHello every one
I've been promising =
it for a long time and I've finally done it. I've
posted the first publi=
cly available alpha version of LCP ( Lib CIM
Perl ).
its available on=
git hub here
=3D"_blank">https://github.com/prmarino1/Lib-CIM-PerlThe curren=
t version implements the following methods from DSP0200
GetClass
=
GetInstance
DeleteClass
EnumerateClasses
EnumerateClassNames
En=
umerateInstances
EnumerateInstanceNames
Associators
AssociatorName=
s
GetProperty
Eventually all other methods from DSP0200 will be i=
mplemented before
1.0 is completed.
It is capable of generating b=
oth simple and multirec queries, however
multirec queries have not been =
thoroughly tested beyond validation of
the XML against the XML schema du=
e to the fact that the OpenPegasus
versions I've tested with don't suppo=
rt them.
it can post
via POST or M-POST over http or https.
has incrementing sequence nu=
mbers for each post it sends.
last but not least has a quick and eas=
y to use simple result parser.
Lib CIM Perl is built completely on t=
op of LWP (Lib WWW Perl ) and
XML::Twig there are no additional librarie=
s other than their
dependencies required.
Lib CIM Perl its self is wr=
itten in pure Perl so there is no need to
install any C based CIM client=
libraries to use it.
Most of the testing so far has been against Op=
enPegasus
keep in mind this is an alpha version and the list of thin=
gs to do
with it is as long as my arm, and some of the API will change s=
oon,
however the API will stabilize shortly once I release version=
0.01.
I would appreciate any constructive feedback people are willing t=
o
give prior to working on the next release
here is a lit=
tle code sample for any one who is interested to get
started
using it
use LCP;
use Data::Dumper;
my $opt=
ions=3D{
'username'=3D>'username',
&nb=
sp; 'password'=3D>'passwd',
=
'protocol'=3D>'http',
'Method'=3D=
>'POST'
};
my $post_counter=3D0;
print "se=
tting up the agent\n";
my $agent=3DLCP::Agent->new('localhost'=
,$options);
print "setting up the session\n";
my $sessi=
on=3DLCP::Session->new($agent);
print "constructing the query\=
n";
my $test=3DLCP::Query->new();
$test->Enumerat=
eClasses('root/cimv2');
print "posting the query\n";
my=
$post=3DLCP::Post->new($session,$test);
if (defined $post and=
$post->{'Result'}->is_success){
print=
"post executed\n";
print
"-at-{[$post->{'Result'}->decoded_content]}\n";
=
my $parser=3DLCP::SimpleParser->new($post->get_raw_xml);
&=
nbsp; my $tree=3D$parser->buildtree;
&nbs=
p; print Dumper($tree) . "\n";
}