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