[#17] Client: Add extra parameter
API methods' parameters types with optional session, polling settings, xHeaders etc. and corresponding handlers have been added Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
00a1e9412f
commit
7b9c19f37c
42 changed files with 1054 additions and 386 deletions
|
@ -7,6 +7,7 @@ using NodeInfo = FrostFS.SDK.ModelsV2.Netmap.NodeInfo;
|
|||
|
||||
using FrostFS.SDK.ModelsV2.Netmap;
|
||||
using static FrostFS.Netmap.NetworkConfig.Types;
|
||||
using FrostFS.SDK.ClientV2.Parameters;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2;
|
||||
|
||||
|
@ -39,14 +40,15 @@ internal class NetmapServiceProvider : ContextAccessor
|
|||
return settings;
|
||||
}
|
||||
|
||||
internal async Task<NodeInfo> GetLocalNodeInfoAsync(Context ctx)
|
||||
internal async Task<NodeInfo> GetLocalNodeInfoAsync(PrmGetNodeInfo args)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
var request = new LocalNodeInfoRequest
|
||||
{
|
||||
Body = new LocalNodeInfoRequest.Types.Body { }
|
||||
};
|
||||
|
||||
request.AddMetaHeader();
|
||||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(Context.Key);
|
||||
|
||||
var response = await netmapServiceClient.LocalNodeInfoAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
|
@ -58,12 +60,9 @@ internal class NetmapServiceProvider : ContextAccessor
|
|||
|
||||
internal async Task<NetworkInfoResponse> GetNetworkInfoAsync(Context ctx)
|
||||
{
|
||||
var request = new NetworkInfoRequest
|
||||
{
|
||||
Body = new NetworkInfoRequest.Types.Body { }
|
||||
};
|
||||
var request = new NetworkInfoRequest();
|
||||
|
||||
request.AddMetaHeader();
|
||||
request.AddMetaHeader(null);
|
||||
request.Sign(Context.Key);
|
||||
|
||||
var response = await netmapServiceClient.NetworkInfoAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
|
@ -73,14 +72,13 @@ internal class NetmapServiceProvider : ContextAccessor
|
|||
return response;
|
||||
}
|
||||
|
||||
internal async Task<NetmapSnapshot> GetNetmapSnapshotAsync(Context ctx)
|
||||
internal async Task<NetmapSnapshot> GetNetmapSnapshotAsync(PrmGetNetmapSnapshot args)
|
||||
{
|
||||
var request = new NetmapSnapshotRequest
|
||||
{
|
||||
Body = new NetmapSnapshotRequest.Types.Body { }
|
||||
};
|
||||
var ctx = args.Context!;
|
||||
|
||||
request.AddMetaHeader();
|
||||
var request = new NetmapSnapshotRequest();
|
||||
|
||||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(Context.Key);
|
||||
|
||||
var response = await netmapServiceClient.NetmapSnapshotAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue