-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
355b0b4
commit b404b11
Showing
13 changed files
with
1,665 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"centraluseuap", | ||
"westeurope", | ||
"northeurope", | ||
"eastus" | ||
"eastus", | ||
"westus2" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/SwiftTestingFrameworkAPI/Controllers/RemoteFileShareController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Azure.Storage.Blobs.Specialized; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using SwiftTestingFrameworkAPI.Utils; | ||
using System; | ||
using System.IO; | ||
|
||
namespace SwiftTestingFrameworkAPI.Controllers | ||
{ | ||
[ApiController] | ||
[Route("FileShare")] | ||
public class RemoteFileShareController : ControllerBase | ||
{ | ||
private readonly ILogger<RemoteFileShareController> _logger; | ||
private const string TestName = "FileShare"; | ||
|
||
public RemoteFileShareController(ILogger<RemoteFileShareController> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
[HttpGet] | ||
public TestResponse GetInfo() | ||
{ | ||
string testDetails = "Write to file share mount through Vnet Integration"; | ||
return new TestResponse(Constants.ApiVersion, TestName, string.Empty, testDetails, string.Empty); | ||
} | ||
|
||
[HttpPost] | ||
public ObjectResult WriteToFileShare() | ||
{ | ||
TestResponse testResponse; | ||
try | ||
{ | ||
System.IO.File.WriteAllText(Constants.MountFilePath, "Hello world!"); | ||
testResponse = new TestResponse(Constants.ApiVersion, TestName, "Success", "Write to remote file share successful.", string.Empty); | ||
return StatusCode(200, testResponse); | ||
} | ||
catch (Exception ex) | ||
{ | ||
//Replace with AntaresEventProvider or email send functionality | ||
testResponse = new TestResponse(Constants.ApiVersion, TestName, "Failure", string.Empty, ex.Message + ex.StackTrace); | ||
return StatusCode(555, testResponse); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.