2022-01-31 11:58:55 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/morph/client"
|
|
|
|
"github.com/TrueCloudLab/frostfs-sdk-go/netmap"
|
2022-01-31 11:58:55 +00:00
|
|
|
)
|
|
|
|
|
2022-09-28 11:34:28 +00:00
|
|
|
// GetNetMap calls "snapshot" method and decodes netmap.NetMap from the response.
|
2022-06-08 23:18:26 +00:00
|
|
|
func (c *Client) GetNetMap(diff uint64) (*netmap.NetMap, error) {
|
2022-01-31 11:58:55 +00:00
|
|
|
prm := client.TestInvokePrm{}
|
|
|
|
prm.SetMethod(snapshotMethod)
|
2022-03-11 09:28:34 +00:00
|
|
|
prm.SetArgs(diff)
|
2022-01-31 11:58:55 +00:00
|
|
|
|
|
|
|
res, err := c.client.TestInvoke(prm)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2023-01-31 10:33:33 +00:00
|
|
|
return DecodeNetMap(res)
|
2022-01-31 11:58:55 +00:00
|
|
|
}
|