On 02/21/2013 08:11 PM, John Dennis wrote:
I've been looking at the Konkret doc and the various OpenLMI
providers
and there seems to be an an inherent assumption that enumerateInstances
will be called exactly once. There are no checks to see if an instance
already exists during the enumeration. I went to the CMPI spec for a
clarification, except it had nothing to say about this (at least as far
I could find).
enumerateInstances will be called for every
EnumerateInstances/EnumerateInstanceNames request that CIMOM receives
from an remote application.
I think that the providers do not run in multiple threads, so there is
only one enumerateInstances() at a time, but I haven't checked that.
My naive assumption for a function with the verb Enumerate in
it's name
followed by the noun Instance says you're suppose to return a list of
existing Instances, not create them. Also you might be asked to
enumerate those same Instances more than once (i.e. give me a list of
what you've got).
Yes, exactly.
But it seems like the actual semantics are "create your initial
set of
default instances and tell me what they are" Hence it has more to do
with creation than enumeration. Is this correct or do I have a
misunderstanding? Is this actually spelled out someplace? If so can you
point me at that doc?
No, the point of CIM and CIMOM is that the instances live only in
providers. CIMOM asks you to enumerate them or get concrete instance,
but it does not keep any state, it just forwards requests from remote
applications to your provider and back.
Even in your provider the instances do not need to be 'alive'. When your
enumerateInstances() is called it's up to you where you get list of
instances from. For example, SBLIM has a provider to show list of
processes and it just executes 'ps -a', parses it and returns the
requested information to CIMOM. It does not keep any state, it parses
'ps -a' again in next enumerateInstances(). Of course, for hard-to-get
information, some caching in your provider is recommended - for storage,
we keep list of block devices and their properties in the provider to
speed things up.
Jan