public NippsApplicationPoolResponse ListApplicationPool() { NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); NippsApplicationPoolResponse response = new NippsApplicationPoolResponse(); response.ResultMessages = new List <string>(); try { using (ServerManager serverManager = ServerManager.OpenRemote("localhost")) { response.NippsApplicationPools = new List <String>(); foreach (ApplicationPool appPool in serverManager.ApplicationPools) { response.NippsApplicationPools.Add(appPool.Name); } response.Result = Result.OK; } } catch (Exception ex) { logger.Error(ex.ToString()); response.Result = Result.FAIL; response.ResultMessages.Add(ex.ToString()); } return(response); }
public static List <String> ListApplicationPool(string hostName) { string deploymentServiceUrl = BuildDeploymentServiceUrl(hostName) + "ListApplicationPool"; NippsApplicationPoolResponse response = RestHelper.RestGet <NippsApplicationPoolResponse>(deploymentServiceUrl); if (response.Result == Result.OK) { return(response.NippsApplicationPools); } foreach (String em in response.ResultMessages) { NLog.LogManager.GetCurrentClassLogger().Error(em); } return(new List <string>()); }