forked from TrueCloudLab/frostfs-api-go
[#418] netmap: Support NetmapService.NetmapSnapshot
RPC
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f3e1f8ae7a
commit
cf868188ef
36 changed files with 1139 additions and 197 deletions
|
@ -11,6 +11,7 @@ const serviceNetmap = serviceNamePrefix + "netmap.NetmapService"
|
|||
const (
|
||||
rpcNetmapNodeInfo = "LocalNodeInfo"
|
||||
rpcNetmapNetInfo = "NetworkInfo"
|
||||
rpcNetmapSnapshot = "NetmapSnapshot"
|
||||
)
|
||||
|
||||
// LocalNodeInfo executes NetmapService.LocalNodeInfo RPC.
|
||||
|
@ -44,3 +45,19 @@ func NetworkInfo(
|
|||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// NetMapSnapshot executes NetmapService.NetmapSnapshot RPC.
|
||||
func NetMapSnapshot(
|
||||
cli *client.Client,
|
||||
req *netmap.SnapshotRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*netmap.SnapshotResponse, error) {
|
||||
resp := new(netmap.SnapshotResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapSnapshot), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue