From: Dave H. <hel...@li...> - 2014-06-06 17:38:46
|
On 06/06/2014 10:43 AM, Klaus Kaempf wrote: > * Alois Mahdal <am...@re...> [Jun 06. 2014 14:43]: >> Hi, >> >> I can't find anywhere description of this (and other) CIM >> properties. >> > > Alois, > > CIM is an object oriented information model and makes heavy use of > inheritance. Look at the definition of CIM_FileSystem[1] and follow the > ancestor chain until you find the definition of EnabledState. > > You will find EnabledState in CIM_EnabledLogicalElement with > "ValueMap" and "Values" qualifiers. These qualifiers provide a mapping > from numeric to textual values. The value '2' for EnabledState maps to > 'Enabled'. > > Hth, > > Klaus > > [1] Yawn > (http://sourceforge.net/apps/mediawiki/pywbem/index.php?title=YAWN) is > a nice tool to view the CIM model > In general, the description of a property can be found in the property's Description Qualifier, in the CIM class in which the property is defined. As Klaus says, CIM makes use of inheritance, so when a class contains a property it's not obvious if the property was defined in the child class or one of the parent classes. One way to find out is to check the MOF file for the class, which is normally found on the CIMOM where the class, and hence, the class' provider, is registered. (the MOF should be packaged with the provider src code as well) To follow your example of Linux_Ext3FileSystem from cmpi-fsvol, on a system running SFCB (since I'm more familiar with it rather than OP ;-), you can search the MOF files for the class in question: [root@cimom ~]# find /usr/local/var/lib/sfcb/stage/ -name \*.mof -exec grep -A4 -H 'class Linux_Ext3FileSystem ' {} \; /usr/local/var/lib/sfcb/stage/mofs/root/cimv2/Linux_Fsvol.mof:class Linux_Ext3FileSystem : CIM_UnixLocalFileSystem /usr/local/var/lib/sfcb/stage/mofs/root/cimv2/Linux_Fsvol.mof-{ /usr/local/var/lib/sfcb/stage/mofs/root/cimv2/Linux_Fsvol.mof- uint8 PercentageSpaceUse; /usr/local/var/lib/sfcb/stage/mofs/root/cimv2/Linux_Fsvol.mof-}; /usr/local/var/lib/sfcb/stage/mofs/root/cimv2/Linux_Fsvol.mof- Not much defined here. The parent class is CIM_UnixLocalFileSystem. But this isn't one of the fsvol classes, it's a CIM base class. So we won't find it in the fsvol MOFs... [root@cimom ~]# find /usr/local/var/lib/sfcb/stage/ -name \*.mof -exec grep -A4 -H 'class CIM_UnixLocalFileSystem ' {} \; but rather in the MOFs for the CIM base schema. SFCB downloads the schema definition from: http://dmtf.org/sites/default/files/cim/cim_schema_v2350/cim_schema_2.35.0Final-MOFs.zip and unpacks it locally here: [root@cimom ~]# find /usr/local/share/sfcb/CIM/ -name \*.mof -exec grep -A4 -iH 'class CIM_UnixLocalFileSystem ' {} \; /usr/local/share/sfcb/CIM/System/CIM_UnixLocalFileSystem.mof:class CIM_UnixLocalFileSystem : CIM_LocalFileSystem { /usr/local/share/sfcb/CIM/System/CIM_UnixLocalFileSystem.mof- /usr/local/share/sfcb/CIM/System/CIM_UnixLocalFileSystem.mof- [Description ( /usr/local/share/sfcb/CIM/System/CIM_UnixLocalFileSystem.mof- "The number of free inodes present in the file system. " /usr/local/share/sfcb/CIM/System/CIM_UnixLocalFileSystem.mof- "This value is only valid if TotalSlots is non-zero." ), [root@cimom ~]# find /usr/local/share/sfcb/CIM/ -name \*.mof -exec grep -A4 -iH 'class CIM_LocalFileSystem ' {} \; /usr/local/share/sfcb/CIM/System/CIM_LocalFileSystem.mof:class CIM_LocalFileSystem : CIM_FileSystem { /usr/local/share/sfcb/CIM/System/CIM_LocalFileSystem.mof- /usr/local/share/sfcb/CIM/System/CIM_LocalFileSystem.mof- /usr/local/share/sfcb/CIM/System/CIM_LocalFileSystem.mof-}; [root@cimom ~]# find /usr/local/share/sfcb/CIM/ -name \*.mof -exec grep -A4 -iH 'class CIM_FileSystem ' {} \; /usr/local/share/sfcb/CIM/System/CIM_FileSystem.mof:class CIM_FileSystem : CIM_EnabledLogicalElement { /usr/local/share/sfcb/CIM/System/CIM_FileSystem.mof- /usr/local/share/sfcb/CIM/System/CIM_FileSystem.mof- [Key, Description ( /usr/local/share/sfcb/CIM/System/CIM_FileSystem.mof- "The scoping System\'s CreationClassName. Note that this " /usr/local/share/sfcb/CIM/System/CIM_FileSystem.mof- "class was originally defined in the scope of a " [root@cimom ~]# find /usr/local/share/sfcb/CIM/ -name \*.mof -exec grep -A4 -iH 'class CIM_EnabledLogicalElement ' {} \; /usr/local/share/sfcb/CIM/Core/CIM_EnabledLogicalElement.mof:class CIM_EnabledLogicalElement : CIM_LogicalElement { /usr/local/share/sfcb/CIM/Core/CIM_EnabledLogicalElement.mof- /usr/local/share/sfcb/CIM/Core/CIM_EnabledLogicalElement.mof- [Description ( /usr/local/share/sfcb/CIM/Core/CIM_EnabledLogicalElement.mof- "EnabledState is an integer enumeration that indicates " /usr/local/share/sfcb/CIM/Core/CIM_EnabledLogicalElement.mof- "the enabled and disabled states of an element. It can " So we follow the inheritance chain all the way back to CIM_EnabledLogicalElement, where the EnabledState property is actually defined. Of course, we check each MOF file along the way to see if the property is defined (or overridden) in that file. In this case we find it in CIM_EnabledLogicalElement.mof: class CIM_EnabledLogicalElement : CIM_LogicalElement { [Description ( "EnabledState is an integer enumeration that indicates " "the enabled and disabled states of an element. It can " "also indicate the transitions between these requested " ... "Starting (10) indicates that the element is in the " "process of going to an Enabled state. New requests are " "queued." ), ValueMap { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11..32767", "32768..65535" }, Values { "Unknown", "Other", "Enabled", "Disabled", "Shutting Down", "Not Applicable", "Enabled but Offline", "In Test", "Deferred", "Quiesce", "Starting", "DMTF Reserved", "Vendor Reserved" }, ModelCorrespondence { "CIM_EnabledLogicalElement.OtherEnabledState" }] uint16 EnabledState = 5; Another, easier way is to use the CIM GetClass call. This causes the CIMOM to walk the inheritance chain for you and report all properties with qualifiers, regardless of where the property is define. Using cimcli: $ cimcli -l localhost -n root/cimv2 gc Linux_Ext3FileSystem Unfortunately wbemcli does not show the qualifier information by default but you can get it by adding the -dx option, which dumps the full CIM-XML response to stderr, and the Description qualifier may be seen there: $ wbemcli -dx gc http://localhost/root/cimv2:Linux_Ext4FileSystem Dave H. |