/// <summary>
        /// 创建逻辑Group
        /// </summary>
        /// <param name="mpClass">The class.</param>
        /// <param name="parentDn">The parent dn.</param>
        /// <param name="parentKey">The parent key.</param>
        /// <returns>Microsoft.EnterpriseManagement.Common.CreatableEnterpriseManagementObject.</returns>
        public MPObject CreateLogicalChildGroup(ManagementPackClass mpClass, string parentDn, string parentKey)
        {
            var obj = new MPObject(MGroup.Instance, mpClass); // 实例化一个class

            obj[this.HuaweiServerKey].Value = parentDn;
            obj[this.ComputerKey].Value     = parentDn;

            obj[this.PartChildGroupKey].Value = parentKey + "-" + mpClass.DisplayName;
            obj[this.DisplayNameField].Value  = mpClass.DisplayName;
            return(obj);
        }
        /// <summary>
        /// Creates the raid control.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// The <see cref="MPObject"/>.
        /// </returns>
        private MPObject CreateFan(HWFAN model)
        {
            var propertys = this.FanClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.FanClass); // 实例化一个class

            obj[propertys["Status"]].Value = model.HealthState;
            obj[propertys["UUID"]].Value   = model.UUID;

            obj[propertys["PresentState"]].Value  = model.PresentState;
            obj[propertys["Speed"]].Value         = model.Rotate;
            obj[propertys["RotatePercent"]].Value = model.RotatePercent;
            obj[this.DisplayNameField].Value      = model.Name;
            return(obj);
        }
        /// <summary>
        /// Creates the disk.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// The <see cref="MPObject"/>.
        /// </returns>
        private MPObject CreateDisk(HWDisk model)
        {
            var propertys = this.PhysicalDiskClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.PhysicalDiskClass); // 实例化一个class

            obj[propertys["UUID"]].Value = model.UUID;

            obj[propertys["Status"]].Value         = model.HealthState;
            obj[propertys["Locator"]].Value        = model.Location;
            obj[propertys["PresentState"]].Value   = model.PresentState;
            obj[propertys["Diskcapacity"]].Value   = string.Empty;
            obj[propertys["IndterfaceType"]].Value = string.Empty;
            obj[this.DisplayNameField].Value       = model.Name;
            return(obj);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates the child Highdensity.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// MPObject.
        /// </returns>
        private MPObject CreateChildHighdensity(ChildHighdensity model)
        {
            var propertys = this.ChildHighdensityClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.ChildHighdensityClass); // 实例化一个class

            obj[propertys["DN"]].Value        = model.DN;
            obj[propertys["Status"]].Value    = model.Status;
            obj[propertys["IPAddress"]].Value = model.IpAddress;
            obj[propertys["UUID"]].Value      = model.UUID;
            obj[propertys["ProductSn"]].Value = model.ProductSn;
            obj[propertys["Type"]].Value      = model.Type;

            obj[this.DisplayNameField].Value = model.Name;
            return(obj);
        }
        /// <summary>
        /// Creates the memory.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// The <see cref="MPObject"/>.
        /// </returns>
        private MPObject CreateMemory(HWMemory model)
        {
            var propertys = this.MemoryClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.MemoryClass); // 实例化一个class

            obj[propertys["Status"]].Value = model.HealthState;
            obj[propertys["UUID"]].Value   = model.UUID;

            obj[propertys["PresentState"]].Value = model.PresentState;
            obj[propertys["Manufacturer"]].Value = model.Manufacturer;
            obj[propertys["Size"]].Value         = model.Capacity;
            obj[propertys["Frequency"]].Value    = model.Frequency;
            obj[this.DisplayNameField].Value     = model.Name;
            return(obj);
        }
        /// <summary>
        /// Creates the raid control.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// The <see cref="MPObject"/>.
        /// </returns>
        private MPObject CreateRaidControl(HWRAID model)
        {
            var propertys = this.RaidClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.RaidClass); // 实例化一个class

            obj[propertys["UUID"]].Value = model.UUID;

            obj[propertys["Status"]].Value          = model.HealthState;
            obj[propertys["Type"]].Value            = model.RaidType;
            obj[propertys["DeviceInterface"]].Value = model.InterfaceType;
            obj[propertys["BBUType"]].Value         = model.BbuType;
            obj[propertys["FirmwareVersion"]].Value = string.Empty;
            obj[propertys["DirverVersion"]].Value   = string.Empty;
            obj[this.DisplayNameField].Value        = model.Name;
            return(obj);
        }
        /// <summary>
        /// Creates the cpu.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>The <see cref="MPObject" />.</returns>
        private MPObject CreateCpu(HWCPU model)
        {
            var propertys = this.CpuClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.CpuClass); // 实例化一个class

            obj[propertys["UUID"]].Value = model.UUID;

            obj[propertys["Status"]].Value       = model.HealthState;
            obj[propertys["Manufacturer"]].Value = model.Manufacturer;
            obj[propertys["PresentState"]].Value = model.PresentState;
            obj[propertys["Type"]].Value         = model.Model;
            obj[propertys["Frequency"]].Value    = model.Frequency;
            obj[propertys["CoreCount"]].Value    = string.Empty;
            obj[this.DisplayNameField].Value     = model.Name;
            return(obj);
        }
        /// <summary>
        /// Creates the power supply.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// MPObject.
        /// </returns>
        private MPObject CreatePowerSupply(HWPSU model)
        {
            var propertys = this.PowerSupplyClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.PowerSupplyClass); // 实例化一个class

            obj[propertys["UUID"]].Value = model.UUID;

            obj[propertys["Status"]].Value       = model.HealthState;
            obj[propertys["Manufacturer"]].Value = model.Manufacturer;
            obj[propertys["InputMode"]].Value    = model.InputMode;
            obj[propertys["Model"]].Value        = model.Model;
            obj[propertys["PowerRating"]].Value  = model.RatePower;
            obj[propertys["InputPower"]].Value   = model.InputPower;
            obj[propertys["PresentState"]].Value = model.PresentState;
            obj[this.DisplayNameField].Value     = model.Name;
            return(obj);
        }
        private MPObject CreateEnclosure(Enclosure model)
        {
            var propertys = this.EnclosureClass.PropertyCollection;
            var obj       = new MPObject(MGroup.Instance, this.EnclosureClass);

            obj[propertys["UnionId"]].Value                = model.UnionId;
            obj[propertys["Name"]].Value                   = model.Name;
            obj[propertys["Type"]].Value                   = model.Type.ToString();
            obj[propertys["FirmwareVersion"]].Value        = model.FirmwareVersion;
            obj[propertys["Hostname"]].Value               = model.Hostname;
            obj[propertys["SerialNumber"]].Value           = model.SerialNumber;
            obj[propertys["PartNumber"]].Value             = model.PartNumber;
            obj[propertys["ProductName"]].Value            = model.ProductName;
            obj[propertys["EnclosureState"]].Value         = model.EnclosureState.ToString();
            obj[propertys["StateReason"]].Value            = model.StateReason;
            obj[propertys["FanSpeedAdjustmentMode"]].Value = model.FanSpeedAdjustmentMode;
            obj[propertys["HMMFloatIPv4Address"]].Value    = model.HMMFloatIPv4Address;
            obj[propertys["Health"]].Value                 = model.Health.ToString();
            obj[this.DisplayNameField].Value               = model.Name;
            return(obj);
        }
Exemplo n.º 10
0
        /// <summary>
        /// The create highdensity server.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <returns>
        /// The <see cref="MPObject"/>.
        /// </returns>
        private MPObject CreateHighdensityServer(HighdensityServer model)
        {
            var propertys = this.HighdensityClass.PropertyCollection;             // 获取到class的属性
            var obj       = new MPObject(MGroup.Instance, this.HighdensityClass); // 实例化一个class

            obj[this.ComputerKey].Value          = model.DN;
            obj[propertys["eSight"]].Value       = model.ESight;
            obj[propertys["Status"]].Value       = model.Status;
            obj[propertys["UUID"]].Value         = model.UUID;
            obj[propertys["Vendor"]].Value       = "HUAWEI";
            obj[propertys["Manufacturer"]].Value = model.Manufacturer;
            obj[propertys["IPAddress"]].Value    = model.IpAddress;
            obj[propertys["iBMCVersion"]].Value  = model.Version;
            obj[propertys["ProductSn"]].Value    = model.ProductSN;
            obj[propertys["ServerName"]].Value   = model.ServerName;

            var entityClass = MGroup.Instance.GetManagementPackClass("System.Entity");

            obj[entityClass.PropertyCollection["DisplayName"]].Value = model.ServerName;
            return(obj);
        }