Example #1
0
        protected override async Task Handle(DeleteDeploymentRequest request, CancellationToken cancellationToken)
        {
            var success = await _deploymentRepository.DeleteDeploymentAsync(request.Id);

            if (!success)
            {
                throw new StatusException(StatusCodes.Status404NotFound,
                                          $"Deployment with id '{request.Id}' does not exist.");
            }
        }
Example #2
0
        public async Task <IHttpActionResult> Delete(string name, string serverName)
        {
            try
            {
                var application = await applicationRepository.GetApplicationAsync(name);

                if (application == null)
                {
                    return(BadRequest("The application " + name + " does not exist."));
                }

                await deploymentRepository.DeleteDeploymentAsync(name, serverName, DateTime.UtcNow);

                return(Ok());
            }
            catch (Exception ex)
            {
                Log.Error("Error in deployment controller:", ex);
                return(InternalServerError());
            }
        }