[#30] Client: Add object model for Rules
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
43e300c773
commit
195854a45b
27 changed files with 677 additions and 155 deletions
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||
|
||||
using Frostfs.V2.Ape;
|
||||
using Frostfs.V2.Apemanager;
|
||||
using Google.Protobuf;
|
||||
|
||||
namespace FrostFS.SDK.Client.Services;
|
||||
|
||||
|
@ -18,11 +19,15 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
|
||||
internal async Task<ReadOnlyMemory<byte>> AddChainAsync(PrmApeChainAdd args, CallContext ctx)
|
||||
{
|
||||
var binary = RuleSerializer.Serialize(args.Chain);
|
||||
|
||||
var base64 = Convert.ToBase64String(binary);
|
||||
|
||||
AddChainRequest request = new()
|
||||
{
|
||||
Body = new()
|
||||
{
|
||||
Chain = new() { Raw = args.Chain.GetRaw() },
|
||||
Chain = new() { Raw = UnsafeByteOperations.UnsafeWrap(binary) },
|
||||
Target = args.Target.GetChainTarget()
|
||||
}
|
||||
};
|
||||
|
@ -43,7 +48,7 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
{
|
||||
Body = new()
|
||||
{
|
||||
ChainId = args.Chain.GetRaw(),
|
||||
ChainId = UnsafeByteOperations.UnsafeWrap(args.ChainId),
|
||||
Target = args.Target.GetChainTarget()
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue