public IHttpActionResult DeletePerformanceTestsLog() { var logFiles = PerformanceLog.FindLogFiles(); if (!logFiles.Any()) { return(NotFound()); } RemoveLogFiles(logFiles); return(Ok()); }
public async Task <IHttpActionResult> GetPerformanceTestsLog([FromUri] DateTime date) { var logFiles = PerformanceLog.FindLogFiles(date); if (!logFiles.Any()) { return(NotFound()); } var content = await CreateLogFilesZip(logFiles).ConfigureAwait(false); var result = ActionContext.Request.CreateResponse(HttpStatusCode.OK); result.Content = new ByteArrayContent(content); result.Content.Headers.Add("IsCompressedContent", "true"); result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { Size = content.Length, FileName = $"performance_test_logs_{date:yyyyMMdd}.zip" }; result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/zip"); return(new ResponseMessageResult(result)); }