forked from TrueCloudLab/frostfs-node
[#311] services/control: Define NetmapSnapshot rpc
Add NetmapSnapshot rpc to ControlService protobuf definition. Recompile proto files. Add required method to server structure. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
88023f3655
commit
28777911fb
4 changed files with 78 additions and 0 deletions
12
pkg/services/control/server/netmap_snapshot.go
Normal file
12
pkg/services/control/server/netmap_snapshot.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package control
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/control"
|
||||
)
|
||||
|
||||
// NetmapSnapshot reads network map snapshot from Netmap storage.
|
||||
func (s *Server) NetmapSnapshot(ctx context.Context, req *control.NetmapSnapshotRequest) (*control.NetmapSnapshotResponse, error) {
|
||||
panic("implement me")
|
||||
}
|
|
@ -58,3 +58,38 @@ func (m *HealthCheckResponse) ReadSignedData(buf []byte) ([]byte, error) {
|
|||
func (m *HealthCheckResponse) SignedDataSize() int {
|
||||
return m.GetBody().Size()
|
||||
}
|
||||
|
||||
// SetBody sets get netmap snapshot request body.
|
||||
func (m *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) {
|
||||
if m != nil {
|
||||
m.Body = v
|
||||
}
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the netmap snapshot request body.
|
||||
func (m *NetmapSnapshotRequest) SetSignature(body *Signature) {
|
||||
if m != nil {
|
||||
m.Signature = body
|
||||
}
|
||||
}
|
||||
|
||||
// SetNetmap sets structure of the current network map.
|
||||
func (m *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) {
|
||||
if m != nil {
|
||||
m.Netmap = v
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets get netmap snapshot response body.
|
||||
func (m *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) {
|
||||
if m != nil {
|
||||
m.Body = v
|
||||
}
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the get netmap snapshot response body.
|
||||
func (m *NetmapSnapshotResponse) SetSignature(v *Signature) {
|
||||
if m != nil {
|
||||
m.Signature = v
|
||||
}
|
||||
}
|
||||
|
|
BIN
pkg/services/control/service.pb.go
generated
BIN
pkg/services/control/service.pb.go
generated
Binary file not shown.
|
@ -10,6 +10,9 @@ option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/control";
|
|||
service ControlService {
|
||||
// Performs health check of the storage node.
|
||||
rpc HealthCheck (HealthCheckRequest) returns (HealthCheckResponse);
|
||||
|
||||
// Returns network map snapshot of the current NeoFS epoch.
|
||||
rpc NetmapSnapshot (NetmapSnapshotRequest) returns (NetmapSnapshotResponse);
|
||||
}
|
||||
|
||||
// Health check request.
|
||||
|
@ -39,3 +42,31 @@ message HealthCheckResponse {
|
|||
// Body signature.
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// Get netmap snapshot request.
|
||||
message NetmapSnapshotRequest {
|
||||
// Get netmap snapshot request body.
|
||||
message Body {
|
||||
}
|
||||
|
||||
// Body of get netmap snapshot request message.
|
||||
Body body = 1;
|
||||
|
||||
// Body signature.
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// Get netmap snapshot request.
|
||||
message NetmapSnapshotResponse {
|
||||
// Get netmap snapshot response body
|
||||
message Body {
|
||||
// Structure of the requested network map.
|
||||
Netmap netmap = 1 [json_name = "netmap"];
|
||||
}
|
||||
|
||||
// Body of get netmap snapshot response message.
|
||||
Body body = 1;
|
||||
|
||||
// Body signature.
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue