Article Number: 000145895
wsman invoke -a EnumerateClassNames --hostname=test_host --port=5985 --username=abc --password=password http://schemas.openwsman.org/wbem/wscim/1/instrinsic --namespace=root/cimv2
<s:Body> <n1:EnumerateClassNames> <n1:name>root/cimv2:CIM_Service</n1:name> <n1:name>root/cimv2:Syslog_RecordInLog</n1:name> <n1:name>root/cimv2:Linux_SambaValidUsersForShare</n1:name> <n1:name>root/cimv2:Linux_BaseBoard</n1:name> <n1:name>root/cimv2:Linux_SambaForceUserForShare</n1:name> <n1:name>root/cimv2:Linux_Processor</n1:name> <n1:name>root/cimv2:CIM_RecordForLog</n1:name> <n1:name>root/cimv2:Linux_SambaShareForService</n1:name> <n1:name>root/cimv2:Linux_SambaServiceConfigurationForService</n1:name> <n1:name>root/cimv2:Linux_SambaHostsForService</n1:name> <n1:name>root/cimv2:Linux_SambaForceUserForGlobal</n1:name> <n1:name>root/cimv2:CIM_OSProcess</n1:name> <n1:name>root/cimv2:CIM_RunningOS</n1:name>...................
L'output è simile a quello riportato sopra e indica che, nel namespace root/cimv2, Linux_Processor è una delle classi registrate. Esistono diverse classi CIM che vengono ereditate quando nuove classi vengono registrate nel namespace root/cimv2 e il comando precedente elenca anche tutti i nomi di queste classi. Come regola generale, è possibile ignorare tutte le classi con il prefisso CIM_. Tutte le classi con il prefisso Linux_ sono le classi registrate dai provider installati in un sistema Linux. Quando si utilizza Dell iDRAC, si è interessati soprattutto alle classi con prefisso DCIM_.
wsman invoke -a GetClass --hostname=test_host --port=5985 --username=abc --password=password http://schemas.openwsman.org/wbem/wscim/1/intrinsic/Linux_Processor --namespace=root/cimv2
Il comando precedente elenca tutte le proprietà definite in Linux_Processor a livello locale. Ciò significa che le proprietà ereditate da altre classi CIM_* non sono elencate con l'implementazione corrente. In genere, dalla definizione di una classe è possibile capire quali metodi sono definiti nella classe, quali parametri devono essere passati a tali metodi, quali proprietà della classe sono proprietà chiave e così via. Tuttavia, poiché il comando precedente restituisce solo le proprietà locali, non è possibile identificare le proprietà chiave nella classe. Anche in questo caso, si tratta di una limitazione di implementazione in wsmancli.
wsman enumerate -M epr http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor -h test_host-P 5985 -u abc -p password -O out <?xml version="1.0" encoding="UTF-8"?> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> <s:Header> <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse</wsa:Action> <wsa:RelatesTo>uuid:ca52c9e9-cd47-1d47-8003-a52924d9bed4</wsa:RelatesTo> <wsa:MessageID>uuid:ca622bb3-cd47-1d47-8097-a52924d9bed4</wsa:MessageID> </s:Header> <s:Body> <wsen:PullResponse> <wsen:EnumerationContext>ca4fdd21-cd47-1d47-8095-a52924d9bed4</wsen:EnumerationContext> <wsen:Items> <wsa:EndpointReference> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> <wsa:ReferenceParameters> <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor</wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector> <wsman:Selector Name="SystemCreationClassName">Linux_ComputerSystem</wsman:Selector> <wsman:Selector Name="SystemName">localhost.localdomain</wsman:Selector> <wsman:Selector Name="CreationClassName">Linux_Processor</wsman:Selector> <wsman:Selector Name="DeviceID">0</wsman:Selector> </wsman:SelectorSet> </wsa:ReferenceParameters> </wsa:EndpointReference> </wsen:Items> </wsen:PullResponse> </s:Body> </s:Envelope>
Di tutti i processori nel sistema di destinazione, l'output precedente è di un solo processore. Nell'output, resourceURI viene elencato come http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor e SelectorSet elenca i valori di __cimnamespace, SystemCreationClassName, SystemName, CreationClassName e DeviceID. Ciò significa che tutte le proprietà nella classe Linux_Processor (ereditate e definite localmente) possono essere utilizzate per identificare in modo univoco un'istanza.
wsman get http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor?SystemCreationClassName="Linux_ComputerSystem",SystemName="localhost.localdomain",CreationClassName="Linux_Processor",DeviceID="3",__cimnamespace="root/cimv2" -h test_host -P 5985 -u abc -p password -O get
Se nella richiesta precedente vengono utilizzate altre proprietà, CIMOM nel back-end non è in grado di identificare un'istanza in modo univoco. Analogamente, se sono presenti alcuni metodi personalizzati che devono essere eseguiti in un'istanza, è possibile utilizzare l'EPR della classe per identificare le proprietà chiave con cui richiamare un metodo.
wsman enumerate -M epr http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_CSProcessor -h test_host -P 5985 -u abc -p password -O out <?xml version="1.0" encoding="UTF-8"?> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> <s:Header> <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/PullResponse</wsa:Action> <wsa:RelatesTo>uuid:2efbfcad-cd4b-1d4b-8003-a52924d9bed4</wsa:RelatesTo> <wsa:MessageID>uuid:2efc1c6f-cd4b-1d4b-80b3-a52924d9bed4</wsa:MessageID> </s:Header> <s:Body> <wsen:PullResponse> <wsen:EnumerationContext>2ef7f6f5-cd4b-1d4b-80b1-a52924d9bed4</wsen:EnumerationContext> <wsen:Items> <wsa:EndpointReference> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> <wsa:ReferenceParameters> <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_CSProcessor</wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector> <wsman:Selector Name="GroupComponent"> <wsa:EndpointReference> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> <wsa:ReferenceParameters> <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_ComputerSystem</wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="CreationClassName">Linux_ComputerSystem</wsman:Selector> <wsman:Selector Name="Name">localhost.localdomain</wsman:Selector> <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector> </wsman:SelectorSet> </wsa:ReferenceParameters> </wsa:EndpointReference> </wsman:Selector> <wsman:Selector Name="PartComponent"> <wsa:EndpointReference> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> <wsa:ReferenceParameters> <wsman:ResourceURI>http://sblim.sf.net/wbem/wscim/1/cim-schema/2/Linux_Processor</wsman:ResourceURI> <wsman:SelectorSet> <wsman:Selector Name="SystemCreationClassName">Linux_ComputerSystem</wsman:Selector> <wsman:Selector Name="SystemName">localhost.localdomain</wsman:Selector> <wsman:Selector Name="CreationClassName">Linux_Processor</wsman:Selector> <wsman:Selector Name="DeviceID">0</wsman:Selector> <wsman:Selector Name="__cimnamespace">root/cimv2</wsman:Selector> </wsman:SelectorSet> </wsa:ReferenceParameters> </wsa:EndpointReference> </wsman:Selector> </wsman:SelectorSet> </wsa:ReferenceParameters> </wsa:EndpointReference> </wsen:Items> </wsen:PullResponse> </s:Body> </s:Envelope>Linux_CSProcessor è un'associazione tra le classi Linux_ComputerSystem e Linux_Processor che stabilisce la relazione in base alla quale i processori sono contenuti nei sistemi di computer e quindi nelle sezioni GroupComponent e PartComponent.
Ubuntu Server LTS
11 Jun 2024
4
Solution