forked from TrueCloudLab/frostfs-node
[#328] container/grpc: Implement AnnounceUsedSpace method
Add AnnounceUsedSpace method that converts gRPC request to v2 request and passes it to v2 client. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8419294f22
commit
7e586aef90
1 changed files with 11 additions and 0 deletions
|
@ -85,3 +85,14 @@ func (s *Server) GetExtendedACL(ctx context.Context, req *containerGRPC.GetExten
|
||||||
|
|
||||||
return container.GetExtendedACLResponseToGRPCMessage(resp), nil
|
return container.GetExtendedACLResponseToGRPCMessage(resp), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AnnounceUsedSpace converts gRPC AnnounceUsedSpaceRequest message and passes it to internal Container service.
|
||||||
|
func (s *Server) AnnounceUsedSpace(ctx context.Context, req *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) {
|
||||||
|
resp, err := s.srv.AnnounceUsedSpace(ctx, container.AnnounceUsedSpaceRequestFromGRPCMessage(req))
|
||||||
|
if err != nil {
|
||||||
|
// TODO: think about how we transport errors through gRPC
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return container.AnnounceUsedSpaceResponseToGRPCMessage(resp), nil
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue