forked from TrueCloudLab/frostfs-node
[#1840] blobstor: Return info about all components
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
6d7ffefec5
commit
4b005d3178
12 changed files with 246 additions and 88 deletions
|
@ -3,6 +3,7 @@ package control
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/control"
|
||||
"google.golang.org/grpc/codes"
|
||||
|
@ -30,7 +31,7 @@ func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (
|
|||
|
||||
si.SetID(*sh.ID)
|
||||
si.SetMetabasePath(sh.MetaBaseInfo.Path)
|
||||
si.SetBlobstorPath(sh.BlobStorInfo.RootPath)
|
||||
si.Blobstor = blobstorInfoToProto(sh.BlobStorInfo)
|
||||
si.SetWriteCachePath(sh.WriteCacheInfo.Path)
|
||||
si.SetPiloramaPath(sh.PiloramaInfo.Path)
|
||||
|
||||
|
@ -64,3 +65,14 @@ func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) (
|
|||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func blobstorInfoToProto(info blobstor.Info) []*control.BlobstorInfo {
|
||||
res := make([]*control.BlobstorInfo, len(info.SubStorages))
|
||||
for i := range info.SubStorages {
|
||||
res[i] = &control.BlobstorInfo{
|
||||
Path: info.SubStorages[i].Path,
|
||||
Type: info.SubStorages[i].Type,
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue