agent projects

master
Tudor Stanciu 2020-12-21 02:35:47 +02:00
parent edb610d6d0
commit f9f35a3781
15 changed files with 261 additions and 0 deletions

View File

@ -0,0 +1,8 @@
using System;
namespace NetworkResurrector.Agent.Application
{
public class Class1
{
}
}

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,8 @@
using System;
namespace NetworkResurrector.Agent.Domain.Data
{
public class Class1
{
}
}

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,8 @@
using System;
namespace NetworkResurrector.Agent.Domain
{
public class Class1
{
}
}

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,39 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

View File

@ -0,0 +1,30 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52975",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"NetworkResurrector.Agent": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -0,0 +1,48 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace NetworkResurrector.Agent
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@ -0,0 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

View File

@ -30,6 +30,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B0C5F0C1-0BF
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{6889D39C-D8DA-4B99-AFC1-F0B6355E73C0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "agent", "agent", "{43C78941-52E6-4AB8-9170-CC7C006E4784}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkResurrector.Agent", "NetworkResurrector.Agent\NetworkResurrector.Agent.csproj", "{E10CEE53-8167-446F-BFF3-B80725BB6C90}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkResurrector.Agent.Application", "NetworkResurrector.Agent.Application\NetworkResurrector.Agent.Application.csproj", "{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkResurrector.Agent.Domain", "NetworkResurrector.Agent.Domain\NetworkResurrector.Agent.Domain.csproj", "{885D5625-028A-4B35-8C89-7EF718BC6E34}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkResurrector.Agent.Domain.Data", "NetworkResurrector.Agent.Domain.Data\NetworkResurrector.Agent.Domain.Data.csproj", "{509767A7-D11C-4143-8D45-01E62DFC2C74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -60,6 +70,22 @@ Global
{8A593A37-7ECA-4EDD-A0A7-86CA88ECC1BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A593A37-7ECA-4EDD-A0A7-86CA88ECC1BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A593A37-7ECA-4EDD-A0A7-86CA88ECC1BD}.Release|Any CPU.Build.0 = Release|Any CPU
{E10CEE53-8167-446F-BFF3-B80725BB6C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E10CEE53-8167-446F-BFF3-B80725BB6C90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E10CEE53-8167-446F-BFF3-B80725BB6C90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E10CEE53-8167-446F-BFF3-B80725BB6C90}.Release|Any CPU.Build.0 = Release|Any CPU
{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}.Release|Any CPU.Build.0 = Release|Any CPU
{885D5625-028A-4B35-8C89-7EF718BC6E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{885D5625-028A-4B35-8C89-7EF718BC6E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{885D5625-028A-4B35-8C89-7EF718BC6E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{885D5625-028A-4B35-8C89-7EF718BC6E34}.Release|Any CPU.Build.0 = Release|Any CPU
{509767A7-D11C-4143-8D45-01E62DFC2C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{509767A7-D11C-4143-8D45-01E62DFC2C74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{509767A7-D11C-4143-8D45-01E62DFC2C74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{509767A7-D11C-4143-8D45-01E62DFC2C74}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -72,6 +98,11 @@ Global
{59049C2B-CEFB-456D-B3D5-D2CF5325AEEB} = {6889D39C-D8DA-4B99-AFC1-F0B6355E73C0}
{8A593A37-7ECA-4EDD-A0A7-86CA88ECC1BD} = {6889D39C-D8DA-4B99-AFC1-F0B6355E73C0}
{6889D39C-D8DA-4B99-AFC1-F0B6355E73C0} = {B0C5F0C1-0BF8-4651-AAFC-BE01F516D7B8}
{43C78941-52E6-4AB8-9170-CC7C006E4784} = {B0C5F0C1-0BF8-4651-AAFC-BE01F516D7B8}
{E10CEE53-8167-446F-BFF3-B80725BB6C90} = {43C78941-52E6-4AB8-9170-CC7C006E4784}
{EE31B126-12EC-46B3-8FB4-AD5BCF14C029} = {43C78941-52E6-4AB8-9170-CC7C006E4784}
{885D5625-028A-4B35-8C89-7EF718BC6E34} = {43C78941-52E6-4AB8-9170-CC7C006E4784}
{509767A7-D11C-4143-8D45-01E62DFC2C74} = {43C78941-52E6-4AB8-9170-CC7C006E4784}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {351D76E9-FE02-4C30-A464-7B29AFC64BC7}