testing remote stuff

This commit is contained in:
kkb 2023-11-17 17:12:41 +01:00
parent 1e05d4576d
commit 3c9ccaafeb
374 changed files with 10526 additions and 2037 deletions

View file

@ -1,11 +1,11 @@
using Insight.Domain.Interfaces;
using Insight.Domain.Messages;
using Insight.Domain.Messages.Agent;
using Insight.Domain.Network;
using Insight.Domain.Network.Agent.Messages;
using System.Management;
using System.Runtime.Versioning;
using static Insight.Domain.Messages.Agent.PhysicalDisk;
using static Insight.Domain.Messages.Agent.StoragePool;
using static Insight.Domain.Messages.Agent.VirtualDisk;
using static Insight.Domain.Network.Agent.Messages.PhysicalDisk;
using static Insight.Domain.Network.Agent.Messages.StoragePool;
using static Insight.Domain.Network.Agent.Messages.VirtualDisk;
namespace Insight.Agent.Network.Handlers;
@ -14,12 +14,16 @@ public class StoragePoolHandler : IMessageHandler<AgentSession>
{
public async ValueTask HandleAsync<TMessage>(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
{
if (message is InventoryRequest)
switch (message)
{
var result = new StoragePoolList();
result.AddRange(GetStoragePool());
case InventoryRequest:
{
var result = new Collection<StoragePool>();
result.AddRange(GetStoragePool());
await sender.SendAsync(result, cancellationToken);
await sender.SendAsync(result, cancellationToken);
break;
}
}
}