NetworkResurrector.Agent.Wrapper
parent
e1bcfc01c0
commit
b08748221a
|
@ -9,4 +9,5 @@ dotnet nuget push NetworkResurrector.Server.Wrapper.1.0.3.2.nupkg -k ***REMOVED*
|
||||||
|
|
||||||
# Agent
|
# Agent
|
||||||
dotnet nuget push NetworkResurrector.Agent.PublishedLanguage.1.0.3.nupkg -k ***REMOVED*** -s https://toodle.ddns.net/public-nuget-server/nuget
|
dotnet nuget push NetworkResurrector.Agent.PublishedLanguage.1.0.3.nupkg -k ***REMOVED*** -s https://toodle.ddns.net/public-nuget-server/nuget
|
||||||
|
dotnet nuget push NetworkResurrector.Agent.Wrapper.1.0.3.nupkg -k ***REMOVED*** -s https://toodle.ddns.net/public-nuget-server/nuget
|
||||||
#######################################################################################################################################################
|
#######################################################################################################################################################
|
|
@ -5,6 +5,7 @@
|
||||||
<Description>Network resurrector agent published language nuget package</Description>
|
<Description>Network resurrector agent published language nuget package</Description>
|
||||||
<PackageProjectUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</PackageProjectUrl>
|
<PackageProjectUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</RepositoryUrl>
|
<RepositoryUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</RepositoryUrl>
|
||||||
|
<RepositoryType>Git</RepositoryType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<Description>Network resurrector agent wrapper nuget package</Description>
|
||||||
|
<PackageProjectUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</PackageProjectUrl>
|
||||||
|
<RepositoryType>Git</RepositoryType>
|
||||||
|
<RepositoryUrl>https://dev.azure.com/tstanciu94/NetworkResurrector</RepositoryUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -7,5 +7,10 @@ namespace NetworkResurrector.Agent.Wrapper.Services
|
||||||
public interface IResurrectorAgentService
|
public interface IResurrectorAgentService
|
||||||
{
|
{
|
||||||
Task<ShutdownResult> Shutdown(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null);
|
Task<ShutdownResult> Shutdown(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null);
|
||||||
|
Task<RestartResult> Restart(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null);
|
||||||
|
Task<SleepResult> Sleep(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null);
|
||||||
|
Task<LogoutResult> Logout(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null);
|
||||||
|
Task<LockResult> Lock(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null);
|
||||||
|
Task<CancelResult> Cancel(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,5 +36,50 @@ namespace NetworkResurrector.Agent.Wrapper.Services
|
||||||
var result = await _httpClient.ExecutePostRequest<ShutdownResult, Shutdown>(ApiRoutes.Shutdown, body);
|
var result = await _httpClient.ExecutePostRequest<ShutdownResult, Shutdown>(ApiRoutes.Shutdown, body);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<RestartResult> Restart(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null)
|
||||||
|
{
|
||||||
|
SetHttpClientBaseAddress(ipAddressOrMachineName, agentPort);
|
||||||
|
|
||||||
|
var body = new Restart { Owner = actionOwner, Options = actionOptions };
|
||||||
|
var result = await _httpClient.ExecutePostRequest<RestartResult, Restart>(ApiRoutes.Restart, body);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<SleepResult> Sleep(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null, ActionOptions actionOptions = null)
|
||||||
|
{
|
||||||
|
SetHttpClientBaseAddress(ipAddressOrMachineName, agentPort);
|
||||||
|
|
||||||
|
var body = new Sleep { Owner = actionOwner, Options = actionOptions };
|
||||||
|
var result = await _httpClient.ExecutePostRequest<SleepResult, Sleep>(ApiRoutes.Sleep, body);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<LogoutResult> Logout(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null)
|
||||||
|
{
|
||||||
|
SetHttpClientBaseAddress(ipAddressOrMachineName, agentPort);
|
||||||
|
|
||||||
|
var body = new Logout { Owner = actionOwner };
|
||||||
|
var result = await _httpClient.ExecutePostRequest<LogoutResult, Logout>(ApiRoutes.Logout, body);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<LockResult> Lock(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null)
|
||||||
|
{
|
||||||
|
SetHttpClientBaseAddress(ipAddressOrMachineName, agentPort);
|
||||||
|
|
||||||
|
var body = new Lock { Owner = actionOwner };
|
||||||
|
var result = await _httpClient.ExecutePostRequest<LockResult, Lock>(ApiRoutes.Lock, body);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<CancelResult> Cancel(string ipAddressOrMachineName, int agentPort, ActionOwner actionOwner = null)
|
||||||
|
{
|
||||||
|
SetHttpClientBaseAddress(ipAddressOrMachineName, agentPort);
|
||||||
|
|
||||||
|
var body = new Cancel { Owner = actionOwner };
|
||||||
|
var result = await _httpClient.ExecutePostRequest<CancelResult, Cancel>(ApiRoutes.Cancel, body);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue