frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Mappers/Netmap/Netmap.cs
Pavel Gross c988ff3c76
All checks were successful
DCO / DCO (pull_request) Successful in 41s
[#11] Add Network Snapshot
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-06-26 12:29:33 +03:00

15 lines
No EOL
427 B
C#

using System.Linq;
using FrostFS.Netmap;
using FrostFS.SDK.ModelsV2.Netmap;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC.Netmap;
public static class NetmapMapper
{
public static NetmapSnapshot ToModel(this NetmapSnapshotResponse netmap)
{
return new NetmapSnapshot(
netmap.Body.Netmap.Epoch,
netmap.Body.Netmap.Nodes.Select(n => n.ToModel(netmap.MetaHeader.Version)).ToArray());
}
}