Hi,
as a follow-up to discussion we had last week regarding LMI API. Sorry
for replying that late, I was working on it but then something else popped
up and I had to work on RHEL7 wor a while.
First: yes the lmiwbem is basically the API I was searching for and
that I believe should be presented as main API for potential LMI users.
For
me as Python test developer, it is far more readable and accessible than
LMIShell, which seems to be aimed for interactive use.
Other thing: as I mentioned, attempt to help fix the subscription problems
right
in the LMIShell got me thinking and I compiled up my own idea of how such
an API
could look like. I called it LPI, LMI Programming API:
http://git.engineering.redhat.com/git/users/amahdal/lpi.git/tree/README.py
Highlight here is probably the query*() and query1*() methods of
`BaseLPIObjectCollection`. I tried to outline an interface where
everything of
interest (i.e. namespace and query result) is child of
`BaseLPIObjectCollection(set)`, and these collections can be created and
queried
by `query()` method, which allows for CQL, WQL, Name/Path-based querying
as well
as using the class itself (instead of "select * from SomeClass").
Other thing I tried to get into the usage pattern was ability to
repeatedly use
the `query()` method(s) on their result. This could allow for more
flexibility
when manipulating with objects and would be even usable in interactive
environment.
But the problem here (as I realized later) is that *I don't know if it's
possible
in WBEM*.
Last idea worth highlighting is the `lpi.q` submodule, which could be
created as
a repository of "pre-fabricated" queries that would follow common
scenarios. (That
could be even more useful in combination with the above "re-quering"
behavior.)
Thanks,
aL.
--
Alois Mahdal <amahdal(a)redhat.com>
Platform QE, BaseOS Daemons
#qa, #brno, #daemons