Is enumerateInstances guaranteed to be called exactly once?

John Dennis jdennis at redhat.com
Fri Feb 22 17:57:03 UTC 2013


On 02/22/2013 02:09 AM, Klaus Kaempf wrote:
> * John Dennis <jdennis at redhat.com> [Feb 21. 2013 20:12]:
>> 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.
>
> Huh ?
>
>> 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).
>
> Well, CMPI only describes the API between the CIMOM and the provider.
> The CIM and WBEM standards from dmtf.org should be consulted here.
>
>>
>> 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.
>
> Yes, in principle.
> Sometimes its practicable to actually create instances in order to get
> their properties and names right. [1]
>
>
>> Also you might be asked
>> to enumerate those same Instances more than once (i.e. give me a
>> list of what you've got).
>
> Absolutely. EnumerateInstances should be idempotent.

Thank you, that confirms what I had believed to be true.

>
>>
>> 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?
>
> This is a misunderstanding. However some providers will actually
> create instances on the initial call to enumerateInstances for
> practical purposes as outlined above.

Well, there in was part of my confusion because the examples I looked at 
made no distinction as to whether this was an initial call to 
enumerateInstances or not, they just blindly created class instances.

Part of my question is also directed toward "What is the life cycle of 
these instances and who owns the instance? Is it the provider or does 
the broker copy the returned instance? Jan Safranek in his reply 
addresses some of these concerns so I will follow up in a bit more 
detail in his reply.

Once again thank you.

-- 
John Dennis <jdennis at redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/


More information about the openlmi-devel mailing list