/// <summary> /// <para>From DMTF Spec:</para>This operation is used to return a single CIM Instance from the target Namespace. /// </summary> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void GetInstance(CimXmlWriter cxw, GetInstanceOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* [...] <IMETHODCALL NAME="GetInstance"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"/> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="IncludeClassOrigin"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="IncludeQualifiers"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="LocalOnly"> <VALUE>FALSE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="PropertyList"> <VALUE.ARRAY> <VALUE>Caption</VALUE> <VALUE>InstanceID</VALUE> <VALUE>ElementName</VALUE> </VALUE.ARRAY> </IPARAMVALUE> <IPARAMVALUE NAME="InstanceName"> <INSTANCENAME CLASSNAME="OMC_InstalledOS"> <KEYBINDING NAME="GroupComponent"> <VALUE.REFERENCE> <LOCALINSTANCEPATH> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"/> </LOCALNAMESPACEPATH> <INSTANCENAME CLASSNAME="OMC_UnitaryComputerSystem"> <KEYBINDING NAME="CreationClassName"> <KEYVALUE VALUETYPE="string">OMC_UnitaryComputerSystem</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="Name"> <KEYVALUE VALUETYPE="string">d1850.cim.lab.novell.com</KEYVALUE> </KEYBINDING> </INSTANCENAME> </LOCALINSTANCEPATH> </VALUE.REFERENCE> </KEYBINDING> <KEYBINDING NAME="PartComponent"> <VALUE.REFERENCE> <LOCALINSTANCEPATH> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"/> </LOCALNAMESPACEPATH> <INSTANCENAME CLASSNAME="OMC_OperatingSystem"> <KEYBINDING NAME="CSName"> <KEYVALUE VALUETYPE="string">d1850.cim.lab.novell.com</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CreationClassName"> <KEYVALUE VALUETYPE="string">OMC_OperatingSystem</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="Name"> <KEYVALUE VALUETYPE="string">Linux</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CSCreationClassName"> <KEYVALUE VALUETYPE="string">OMC_UnitaryComputerSystem</KEYVALUE> </KEYBINDING> </INSTANCENAME> </LOCALINSTANCEPATH> </VALUE.REFERENCE> </KEYBINDING> </INSTANCENAME> </IPARAMVALUE> </IMETHODCALL> [...] */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("GetInstance"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); // Set the OpSettings cxw.WriteLocalOnly(settings.LocalOnly); cxw.WriteIncludeQualifiers(settings.IncludeQualifiers); cxw.WriteIncludeClassOrigin(settings.IncludeClassOrigin); cxw.WritePropertyList(settings.PropertyList); cxw.WriteIParameterElement(); // <IPARAMVALUE NAME="InstanceName"> cxw.WriteCimNameAttributeString("InstanceName"); cxw.WriteCimInstanceName(settings.InstanceName); // <INSTANCENAME CLASSNAME="OMC_InstalledOS">[...] cxw.WriteEndElement(); // </IPARAMVALUE> //</IMETHODCALL> cxw.WriteEndElement(); }
/// <summary> /// <para>From DMTF Spec:</para>This operation is used to enumerate instances of a CIM Class (this includes instances in the class and any subclasses in accordance with the polymorphic nature of CIM objects) in the target Namespace. /// </summary> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void EnumerateInstances(CimXmlWriter cxw, EnumerateInstancesOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* <IMETHODCALL NAME="EnumerateInstances"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"/> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="IncludeClassOrigin"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="IncludeQualifiers"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="PropertyList"> <VALUE.ARRAY> <VALUE>Caption</VALUE> <VALUE>InstanceID</VALUE> <VALUE>ElementName</VALUE> </VALUE.ARRAY> </IPARAMVALUE> <IPARAMVALUE NAME="LocalOnly"> <VALUE>FALSE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="ClassName"> <CLASSNAME NAME="CIM_Component"/> </IPARAMVALUE> <IPARAMVALUE NAME="DeepInheritance"> <VALUE>TRUE</VALUE> </IPARAMVALUE> </IMETHODCALL> */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("EnumerateInstances"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); // Set the OpSettings cxw.WriteIncludeClassOrigin(settings.IncludeClassOrigin); cxw.WriteClassNameParam(settings.ClassName); cxw.WriteIncludeQualifiers(settings.IncludeQualifiers); cxw.WriteDeepInheritance(settings.DeepInheritance); cxw.WriteLocalOnly(settings.LocalOnly); cxw.WritePropertyList(settings.PropertyList); //</IMETHODCALL> cxw.WriteEndElement(); }
/// <summary> /// <para>From DMTF Spec:</para>This operation is used to return a single CIM Class from the target Namespace. /// </summary> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void GetClass(CimXmlWriter cxw, GetClassOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="1001" PROTOCOLVERSION="1.0"> <SIMPLEREQ> <IMETHODCALL NAME="GetClass"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"/> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="IncludeClassOrigin"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="ClassName"> <CLASSNAME NAME="CIM_PhysicalAssetCapabilities"/> </IPARAMVALUE><IPARAMVALUE NAME="IncludeQualifiers"> <VALUE>TRUE</VALUE> </IPARAMVALUE> <IPARAMVALUE NAME="PropertyList"> <VALUE.ARRAY> <VALUE>Caption</VALUE> <VALUE>InstanceID</VALUE> <VALUE>ElementName</VALUE> </VALUE.ARRAY> </IPARAMVALUE> <IPARAMVALUE NAME="LocalOnly"> <VALUE>FALSE</VALUE> </IPARAMVALUE> </IMETHODCALL> </SIMPLEREQ> </MESSAGE> </CIM> */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("GetClass"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); // Set the OpSettings cxw.WriteIncludeClassOrigin(settings.IncludeClassOrigin); cxw.WriteClassNameParam(settings.ClassName); cxw.WriteIncludeQualifiers(settings.IncludeQualifiers); cxw.WriteLocalOnly(settings.LocalOnly); cxw.WritePropertyList(settings.PropertyList); //</IMETHODCALL> cxw.WriteEndElement(); }
/// <summary> /// <para>From DMTF Spec:</para>This operation is used to modify an existing CIM Instance in the target Namespace. The Instance MUST already exist. /// </summary> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void ModifyInstance(CimXmlWriter cxw, ModifyInstanceOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("ModifyInstance"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); //<IPARAMVALUE NAME="ModifiedInstance"> cxw.WriteIParameterElement(); cxw.WriteCimNameAttributeString("ModifiedInstance"); cxw.WriteCimInstance(settings.ModifiedInstance); //</IPARAMVALUE> cxw.WriteEndElement(); cxw.WriteIncludeQualifiers(settings.IncludeQualifiers); cxw.WritePropertyList(settings.PropertyList); //</IMETHODCALL> cxw.WriteEndElement(); }