예제 #1
0
        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();
        }
예제 #2
0
        /// <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();
        }
예제 #3
0
        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();
        }
예제 #4
0
        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();
        }
예제 #5
0
        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();
        }
예제 #6
0
        /// <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();
        }