* Pavel Březina <pbrezina(a)redhat.com> [Dec 04. 2013 15:17]:
I'm starting to think that I misinterpreted what the instance is in
the context of cmpi. I probably tried to work with it too much as in
OOP.
GetInstance() should return new instance according to object path
and recreate all non-key properties?
Pavel,
cmpi providers are used to model the 'real world' into the CIM
information model. Instances in CIM are instantiated classes,
representing an underlying 'thing' (network interface, running
process, installed package, hardware item, ...). The common name is
'configuration item' or 'CI' - something contributing to the overall
service configuration.
GetInstance() returns a current view of the configuration item
according to the respective CIM class. In the CIM information model,
this is a list of typed properties with values. The key properties are
a set of instance properties uniquely identifing this instance.
And ModifyInstance() should modify the instance so that it can be
recreated by GetInstance()?
ModifyInstance() should modify the underlying configuration item
according to the changed properties passed in the ModifyInstance()
call. This is somewhat delicate and used very seldomly. The usual
means of actually changing configuration items is via instance methods
or ElementSettingData. See the service profiles
(
http://www.dmtf.org/standards/profiles)
So if the instance is not stored in some sort of memory and is
currently hardcoded into a provider, I have no tools to modify the
instance?
Yes. Esp. since providers are dynamic and can be unloaded by the CIMOM
at any time.
However, for CIM instances not representing a configuration item, the
CIMOM provides the ability to store instances in the CIMOM database.
For testing purposes, you can make your provider 'sticky' by returning
a 'do not unload' response to a cleanup request. But this is actually
considered bad practice.
Hth,
Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG
Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany