pywbem / pywbem

Pywbem - A WBEM client and related utilities, written in pure Python.
https://pywbem.github.io
GNU Lesser General Public License v2.1
41 stars 26 forks source link

How to get cim_schema file or schema_version in storage #1896

Closed allen0817 closed 5 years ago

allen0817 commented 5 years ago

hi andy-maier : How to get cim_schema file or schema_version in storage,please @andy-maier

andy-maier commented 5 years ago

The SMI-S standard uses the standard DMTF CIM Schema, if that your question. The CIM Schema version is not represented in the schema in one place. If you look at the Version qualifier of all classes in the CIM Schema, the highest number you find is the version of the CIM Schema. Let me know in case that does not answer your question.

allen0817 commented 5 years ago

Unsolved, I did not find the version field in the class. Since GetClass() is not supported, I need to know its version number and see the class definition from the corresponding version base class

allen0817 commented 5 years ago

such as this Get the description of the attribute EnabledState

code:

state = conn.GetClass('HuaSy_DiskDrive',PropertyList='EnabledState') state CIMClass(classname='HuaSy_DiskDrive', superclass='SNIA_DiskDrive', properties=NocaseDict({}), methods=NocaseDict({}), qualifiers=NocaseDict({'Abstract': CIMQualifier(name='Abstract', value=True, type='boolean', tosubclass=False, overridable=True, translatable=False, toinstance=False, propagated=False)}), path=CIMClassName(classname='HuaSy_DiskDrive', namespace='root/huawei', host='192.168.1.101'))

KSchopmeyer commented 5 years ago

What server are you trying to get the schema version from??? The Enumerateclasses (EnumerateClasses (namespace=, DeepInheritance=True, IncludeQualifiers=True)) should return all of the classes for the defined namespaces. Almost all servers support the EnumerateClasses operation.

andy-maier commented 5 years ago

@KSchopmeyer I assume it is an SFCB based SMI-S installation. @allen0817 In that case, you cannot determine the CIM Schema version. Is there a reason you need specifically the CIM Schema version? You could use the SMI-S version which you can get from the RegisteredVersion property of the corresponding CIM_RegisteredProfile instance.