frostfs-sdk-go/api/rpc/apemanager.go
Pavel Pogodaev 6ce73790ea [#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-22 14:05:12 +00:00

60 lines
1.5 KiB
Go

package rpc
import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/client"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/common"
)
const serviceAPEManager = frostfsServiceNamePrefix + "apemanager.APEManagerService"
const (
rpcAPEManagerAddChain = "AddChain"
rpcAPEManagerRemoveChain = "RemoveChain"
rpcAPEManagerListChains = "ListChains"
)
func AddChain(
cli *client.Client,
req *apemanager.AddChainRequest,
opts ...client.CallOption,
) (*apemanager.AddChainResponse, error) {
resp := new(apemanager.AddChainResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerAddChain), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func RemoveChain(
cli *client.Client,
req *apemanager.RemoveChainRequest,
opts ...client.CallOption,
) (*apemanager.RemoveChainResponse, error) {
resp := new(apemanager.RemoveChainResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerRemoveChain), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func ListChains(
cli *client.Client,
req *apemanager.ListChainsRequest,
opts ...client.CallOption,
) (*apemanager.ListChainsResponse, error) {
resp := new(apemanager.ListChainsResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerListChains), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}