/// <summary> /// 根据IP查找ESight实体。 /// </summary> /// <param name="hostIp">The host ip.</param> /// <returns>The <see cref="HWESightHost" />.</returns> public HWESightHost GetEntityByHostIp(string hostIp) { IObjectReader <EnterpriseManagementObject> items = OM12Connection.Query <EnterpriseManagementObject>(ESightAppliance.EntityClassName, $"Host='{hostIp}'"); return(items.Select(ConvertMonitoringObjectToESightHost()).FirstOrDefault()); }
/// <summary> /// 根据订阅ID查询eSight /// </summary> /// <param name="subscribeId">The subscribe identifier.</param> /// <returns>Huawei.SCOM.ESightPlugin.Models.HWESightHost.</returns> public HWESightHost GetEntityBySubscribeId(string subscribeId) { IObjectReader <EnterpriseManagementObject> items = OM12Connection.Query <EnterpriseManagementObject>(ESightAppliance.EntityClassName, $"SubscribeID='{subscribeId}'"); return(items.Select(ConvertMonitoringObjectToESightHost()).FirstOrDefault()); }
/// <summary> /// The get list. /// </summary> /// <param name="condition"> /// The condition. /// </param> /// <returns> /// The <see> /// <cref>IList</cref> /// </see> /// . /// </returns> public IList <HWESightHost> GetList(string condition = "1=1 ") { IObjectReader <EnterpriseManagementObject> monitoringObjects = OM12Connection.All <EnterpriseManagementObject>(ESightAppliance.EntityClassName); IEnumerable <HWESightHost> appliances = monitoringObjects.Select(ConvertMonitoringObjectToESightHost()); return(appliances.OrderByDescending(x => x.CreateTime).ToList()); }