[#1048] control: Add ListShards RPC wrappers

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-17 18:23:46 +03:00 committed by Alex Vanin
parent a6b3e16975
commit f88a12eaa7
2 changed files with 41 additions and 0 deletions

View file

@ -12,6 +12,7 @@ const (
rpcNetmapSnapshot = "NetmapSnapshot"
rpcSetNetmapStatus = "SetNetmapStatus"
rpcDropObjects = "DropObjects"
rpcListShards = "ListShards"
)
// HealthCheck executes ControlService.HealthCheck RPC.
@ -100,3 +101,24 @@ func DropObjects(
return wResp.m, nil
}
// ListShards executes ControlService.ListShards RPC.
func ListShards(
cli *client.Client,
req *ListShardsRequest,
opts ...client.CallOption,
) (*ListShardsResponse, error) {
wResp := &listShardsRequestWrapper{
m: new(ListShardsResponse),
}
wReq := &requestWrapper{
m: req,
}
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcListShards), wReq, wResp, opts...)
if err != nil {
return nil, err
}
return wResp.m, nil
}