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