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