Evgenii Stratonikov
3dfa2f4fd6
All checks were successful
DCO action / DCO (pull_request) Successful in 1m0s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m22s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m25s
Tests and linters / Lint (pull_request) Successful in 1m32s
Tests and linters / Tests with -race (pull_request) Successful in 2m20s
Remove SetExtendedEACL and AnnounceUsedSpace methods from the container package. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
98 lines
2.5 KiB
Go
98 lines
2.5 KiB
Go
package rpc
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common"
|
|
)
|
|
|
|
const serviceContainer = serviceNamePrefix + "container.ContainerService"
|
|
|
|
const (
|
|
rpcContainerPut = "Put"
|
|
rpcContainerGet = "Get"
|
|
rpcContainerDel = "Delete"
|
|
rpcContainerList = "List"
|
|
rpcContainerGetEACL = "GetExtendedACL"
|
|
rpcContainerUsedSpace = "AnnounceUsedSpace"
|
|
)
|
|
|
|
// PutContainer executes ContainerService.Put RPC.
|
|
func PutContainer(
|
|
cli *client.Client,
|
|
req *container.PutRequest,
|
|
opts ...client.CallOption,
|
|
) (*container.PutResponse, error) {
|
|
resp := new(container.PutResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerPut), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// GetContainer executes ContainerService.Get RPC.
|
|
func GetContainer(
|
|
cli *client.Client,
|
|
req *container.GetRequest,
|
|
opts ...client.CallOption,
|
|
) (*container.GetResponse, error) {
|
|
resp := new(container.GetResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerGet), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// DeleteContainer executes ContainerService.Delete RPC.
|
|
func DeleteContainer(
|
|
cli *client.Client,
|
|
req *container.DeleteRequest,
|
|
opts ...client.CallOption,
|
|
) (*container.PutResponse, error) {
|
|
resp := new(container.PutResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerDel), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// ListContainers executes ContainerService.List RPC.
|
|
func ListContainers(
|
|
cli *client.Client,
|
|
req *container.ListRequest,
|
|
opts ...client.CallOption,
|
|
) (*container.ListResponse, error) {
|
|
resp := new(container.ListResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerList), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// GetEACL executes ContainerService.GetExtendedACL RPC.
|
|
func GetEACL(
|
|
cli *client.Client,
|
|
req *container.GetExtendedACLRequest,
|
|
opts ...client.CallOption,
|
|
) (*container.GetExtendedACLResponse, error) {
|
|
resp := new(container.GetExtendedACLResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerGetEACL), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|