/// <summary> /// Get the value of a property of an InstanceName /// </summary> /// <param name="cxw"></param> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> public static void GetProperty(CimXmlWriter cxw, GetPropertyOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="87872" PROTOCOLVERSION="1.0"> <SIMPLEREQ> <IMETHODCALL NAME="GetProperty"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="root"/> <NAMESPACE NAME="myNamespace"/> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="InstanceName"> <INSTANCENAME CLASSNAME="MyDisk"> <KEYBINDING NAME="DeviceID"><KEYVALUE>C:</KEYVALUE></KEYBINDING> </INSTANCENAME> </IPARAMVALUE> <IPARAMVALUE NAME="PropertyName"><VALUE>FreeSpace</VALUE></IPARAMVALUE> </IMETHODCALL> </SIMPLEREQ> </MESSAGE> </CIM> */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("GetProperty"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("InstanceName"); cxw.WriteCimInstanceName(settings.InstanceName); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("PropertyName"); cxw.WriteValueString(settings.PropertyName); cxw.WriteEndElement();//</IPARAMVALUE> //</IMETHODCALL> cxw.WriteEndElement(); }
public static void GetQualifier(CimXmlWriter cxw, GetQualifierOpSettings settings, CimName defaultNamespace) { // Set the Method Name cxw.WriteIMethodCallStartElement("GetQualifier"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("QualifierName"); cxw.WriteValueString(settings.QualifierName); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteEndElement(); }
public static void ExecuteQuery(CimXmlWriter cxw, ExecuteQueryOpSettings settings, CimName defaultNamespace) { // Set the Method Name cxw.WriteIMethodCallStartElement("ExecuteQuery"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("QueryLanguage"); cxw.WriteValueString(settings.QueryLanguage); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("Query"); cxw.WriteValueString(settings.Query); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteEndElement(); }
/// <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 delete 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 DeleteInstance(CimXmlWriter cxw, DeleteInstanceOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* <?xml version="1.0" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="24" PROTOCOLVERSION="1.0"> <SIMPLEREQ> <IMETHODCALL NAME="DeleteInstance"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"></NAMESPACE> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="InstanceName"> <INSTANCENAME CLASSNAME="CIM_NFS"> <KEYBINDING NAME="CSCreationClassName"> <KEYVALUE VALUETYPE="string">twiest-3</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CSName"> <KEYVALUE VALUETYPE="string">twiest-3</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CreationClassName"> <KEYVALUE VALUETYPE="string">twiest-3</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="Name"> <KEYVALUE VALUETYPE="string">twiest-3</KEYVALUE> </KEYBINDING> </INSTANCENAME> </IPARAMVALUE> </IMETHODCALL> </SIMPLEREQ> </MESSAGE> </CIM> */ #endregion // Set the Method Name //<IMETHODCALL NAME="DeleteInstance"> cxw.WriteIMethodCallStartElement("DeleteInstance"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); //<IPARAMVALUE NAME="InstanceName"> cxw.WriteIParameterElement(); cxw.WriteCimNameAttributeString("InstanceName"); cxw.WriteCimInstanceName(settings.InstanceName); //</IPARAMVALUE> cxw.WriteEndElement(); //</IMETHODCALL> cxw.WriteEndElement(); }
public static void AssociatorNames(CimXmlWriter cxw, AssociatorNamesOpSettings settings, CimName defaultNamespace) { #region Acutal XML request /* <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="40" PROTOCOLVERSION="1.0"> <SIMPLEREQ> <IMETHODCALL NAME="AssociatorNames"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="smash"></NAMESPACE> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="ObjectName"> <INSTANCENAME CLASSNAME="CIM_NFS"> <KEYBINDING NAME="CSCreationClassName"> <KEYVALUE VALUETYPE="string">tCSCreationClassName</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CSName"> <KEYVALUE VALUETYPE="string">tCSName</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="CreationClassName"> <KEYVALUE VALUETYPE="string">tCreationClassName</KEYVALUE> </KEYBINDING> <KEYBINDING NAME="Name"> <KEYVALUE VALUETYPE="string">tName</KEYVALUE> </KEYBINDING> </INSTANCENAME> </IPARAMVALUE> </IMETHODCALL> </SIMPLEREQ> </MESSAGE> </CIM> */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("AssociatorNames"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); // Write out the ObjectName cxw.WriteCimObjectName(settings); if (settings.AssocClass != null) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("AssocClass"); cxw.WriteClassName(settings.AssocClass); cxw.WriteEndElement();//</IPARAMVALUE> } if (settings.ResultClass != null) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("ResultClass"); cxw.WriteClassName(settings.ResultClass); cxw.WriteEndElement();//</IPARAMVALUE> } if ((settings.Role != null) && (settings.Role != string.Empty)) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("Role"); cxw.WriteValueString(settings.Role); cxw.WriteEndElement();//</IPARAMVALUE> } if ((settings.ResultRole != null) && (settings.ResultRole != string.Empty)) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("ResultRole"); cxw.WriteValueString(settings.ResultRole); cxw.WriteEndElement();//</IPARAMVALUE> } cxw.WriteEndElement(); }
/// <summary> /// <para>From DMTF Spec:</para>This operation is used to create a single CIM Class in the target Namespace. The Class MUST NOT already exist. /// </summary> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void CreateClass(CimXmlWriter cxw, CreateClassOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="87872" PROTOCOLVERSION="1.0"> <SIMPLEREQ> <IMETHODCALL NAME="CreateClass"> <LOCALNAMESPACEPATH> <NAMESPACE NAME="root"/> <NAMESPACE NAME="cimv2"/> </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewClass"> <CLASS NAME="MySchema_VideoBIOSElement" SUPERCLASS="CIM_VideoBIOSElement"> ... </CLASS> </IPARAMVALUE> </IMETHODCALL> </SIMPLEREQ> </MESSAGE> </CIM> */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("CreateClass"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); //<IPARAMVALUE NAME="NewInstance"> cxw.WriteIParameterElement(); cxw.WriteCimNameAttributeString("NewClass"); cxw.WriteCimClass(settings.NewClass); //</IPARAMVALUE> cxw.WriteEndElement(); //</IMETHODCALL> cxw.WriteEndElement(); }
public static void Associators(CimXmlWriter cxw, AssociatorsOpSettings settings, CimName defaultNamespace) { // Set the Method Name cxw.WriteIMethodCallStartElement("Associators"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); // Write out the ObjectName //cxw.WriteCimObjectName(settings.ObjectName); cxw.WriteCimObjectName(settings); if (settings.AssocClass != null) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("AssocClass"); cxw.WriteClassName(settings.AssocClass); cxw.WriteEndElement();//</IPARAMVALUE> } if (settings.ResultClass != null) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("ResultClass"); cxw.WriteClassName(settings.ResultClass); cxw.WriteEndElement();//</IPARAMVALUE> } if ((settings.Role != null) && (settings.Role != string.Empty)) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("Role"); cxw.WriteValueString(settings.Role); cxw.WriteEndElement();//</IPARAMVALUE> } if ((settings.ResultRole != null) && (settings.ResultRole != string.Empty)) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("ResultRole"); cxw.WriteValueString(settings.ResultRole); cxw.WriteEndElement();//</IPARAMVALUE> } if (settings.IncludeQualifiers == true) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("IncludeQualifiers"); cxw.WriteValueString(settings.IncludeQualifiers.ToString()); cxw.WriteEndElement();//</IPARAMVALUE> } if (settings.IncludeClassOrigin == true) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("IncludeClassOrigin"); cxw.WriteValueString(settings.IncludeClassOrigin.ToString()); cxw.WriteEndElement();//</IPARAMVALUE> } if ((settings.PropertyList != null) && (settings.PropertyList.Length > 0)) { cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("PropertyList"); cxw.WritePropertyList(settings.PropertyList); cxw.WriteEndElement(); } cxw.WriteEndElement(); }
/// <summary> /// Sets the value of a property on the Cimom /// </summary> /// <param name="cxw"></param> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> public static void SetProperty(CimXmlWriter cxw, SetPropertyOpSettings settings, CimName defaultNamespace) { // Set the Method Name cxw.WriteIMethodCallStartElement("SetProperty"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("InstanceName"); cxw.WriteCimInstanceName(settings.InstanceName); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("PropertyName"); cxw.WriteValueString(settings.PropertyName); cxw.WriteEndElement();//</IPARAMVALUE> cxw.WriteIParameterElement(); cxw.WriteNameAttributeString("NewValue"); cxw.WriteValueString(settings.NewValue); cxw.WriteEndElement();//</IPARAMVALUE> //</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(); }
/// <summary> /// <para>From DMTF Spec:</para>This operation is used to modify an existing CIM Class in the target Namespace. The Class MUST already exist. /// </summary> /// <param name="settings"></param> /// <param name="defaultNamespace"></param> /// <returns>The CimXml request as a string.</returns> public static void ModifyClass(CimXmlWriter cxw, ModifyClassOpSettings settings, CimName defaultNamespace) { #region Actual XML Request /* */ #endregion // Set the Method Name cxw.WriteIMethodCallStartElement("ModifyClass"); // Set the namespace cxw.WriteCimNamespace(defaultNamespace); cxw.WriteIParameterElement(); cxw.WriteCimNameAttributeString("ModifiedClass"); cxw.WriteCimClass(settings.ModifiedClass); //</IPARAMVALUE> cxw.WriteEndElement(); //</IMETHODCALL> cxw.WriteEndElement(); }