frostfs-node/pkg/morph/client/netmap/snapshot.go
Anton Nikiforov 515c60bdf4 [#1889] adm: Add command morph netmap-candidates
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-02-06 17:26:34 +03:00

20 lines
469 B
Go

package netmap
import (
"github.com/TrueCloudLab/frostfs-node/pkg/morph/client"
"github.com/TrueCloudLab/frostfs-sdk-go/netmap"
)
// GetNetMap calls "snapshot" method and decodes netmap.NetMap from the response.
func (c *Client) GetNetMap(diff uint64) (*netmap.NetMap, error) {
prm := client.TestInvokePrm{}
prm.SetMethod(snapshotMethod)
prm.SetArgs(diff)
res, err := c.client.TestInvoke(prm)
if err != nil {
return nil, err
}
return DecodeNetMap(res)
}