Ejemplo n.º 1
0
        /// <summary>
        /// Excecutes the specified deploy entity.
        /// </summary>
        /// <param name="deployEntity">The deploy entity.</param>
        public void Excecute(dynamic deployEntity)
        {
            //ToDo:yet to complete the entire task
            var serverDetailsModel = (ServerDetailsModel)deployEntity;

            var serverStopHandler = new ServerStopHandler();

            foreach (var server in serverDetailsModel.ServerList)
            {
                serverStopHandler.StopServerCommand(server.ServerUrl);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets this instance.
        /// </summary>
        /// <returns></returns>
        public HttpResponseMessage Get([FromUri] string region)
        {
            var serverDetails = new ConfigFileReader().ReadConfigFile(new ServerDetailsModel
            {
                Region = region
            });

            var serverResponse = new HttpResponseMessage();

            foreach (var server in serverDetails.ServerList)
            {
                serverResponse = new ServerStopHandler().StopServerCommand(server.ServerUrl);
            }
            return serverResponse.StatusCode == HttpStatusCode.OK
                       ? Request.CreateResponse(HttpStatusCode.OK, "Server is stopped")
                       : Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "server stop task incomplete");
        }