diff --git a/pkg/services/control/server/netmap_snapshot.go b/pkg/services/control/server/netmap_snapshot.go new file mode 100644 index 000000000..6643da14a --- /dev/null +++ b/pkg/services/control/server/netmap_snapshot.go @@ -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") +} diff --git a/pkg/services/control/service.go b/pkg/services/control/service.go index 874acfe48..4cde4be0d 100644 --- a/pkg/services/control/service.go +++ b/pkg/services/control/service.go @@ -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 + } +} diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index f5810bea9..2186fc1e3 100644 Binary files a/pkg/services/control/service.pb.go and b/pkg/services/control/service.pb.go differ diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index 74e4aa381..39c508cb7 100644 --- a/pkg/services/control/service.proto +++ b/pkg/services/control/service.proto @@ -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; +}