forked from TrueCloudLab/frostfs-node
[#770] control: Generate gRPC methods to manipulate APE chains
* Define new types and gRPC methods to manipulate APE chains in control service. * Stub gRPC handlers for the generated methods. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
70ab1ebd54
commit
3a2c319b87
5 changed files with 138 additions and 0 deletions
24
pkg/services/control/server/policy_engine.go
Normal file
24
pkg/services/control/server/policy_engine.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package control
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control"
|
||||
)
|
||||
|
||||
func (s *Server) AddChainLocalOverride(ctx context.Context, req *control.AddChainLocalOverrideRequest) (*control.AddChainLocalOverrideResponse, error) {
|
||||
return nil, fmt.Errorf("not implemented yet")
|
||||
}
|
||||
|
||||
func (s *Server) GetChainLocalOverride(ctx context.Context, req *control.GetChainLocalOverrideRequest) (*control.GetChainLocalOverrideResponse, error) {
|
||||
return nil, fmt.Errorf("not implemented yet")
|
||||
}
|
||||
|
||||
func (s *Server) ListChainLocalOverrides(ctx context.Context, req *control.ListChainLocalOverridesRequest) (*control.ListChainLocalOverridesResponse, error) {
|
||||
return nil, fmt.Errorf("not implemented yet")
|
||||
}
|
||||
|
||||
func (s *Server) RemoveChainLocalOverride(ctx context.Context, req *control.RemoveChainLocalOverrideRequest) (*control.RemoveChainLocalOverrideResponse, error) {
|
||||
return nil, fmt.Errorf("not implemented yet")
|
||||
}
|
BIN
pkg/services/control/service.pb.go
generated
BIN
pkg/services/control/service.pb.go
generated
Binary file not shown.
|
@ -44,6 +44,18 @@ service ControlService {
|
|||
|
||||
// Doctor performs storage restructuring operations on engine.
|
||||
rpc Doctor (DoctorRequest) returns (DoctorResponse);
|
||||
|
||||
// Add local access policy engine overrides to a node.
|
||||
rpc AddChainLocalOverride (AddChainLocalOverrideRequest) returns (AddChainLocalOverrideResponse);
|
||||
|
||||
// Get local access policy engine overrides stored in the node by chain id.
|
||||
rpc GetChainLocalOverride (GetChainLocalOverrideRequest) returns (GetChainLocalOverrideResponse);
|
||||
|
||||
// List local access policy engine overrides stored in the node by container id.
|
||||
rpc ListChainLocalOverrides (ListChainLocalOverridesRequest) returns (ListChainLocalOverridesResponse);
|
||||
|
||||
// Remove local access policy engine overrides stored in the node by chaind id.
|
||||
rpc RemoveChainLocalOverride (RemoveChainLocalOverrideRequest) returns (RemoveChainLocalOverrideResponse);
|
||||
}
|
||||
|
||||
// Health check request.
|
||||
|
@ -405,3 +417,105 @@ message StopShardEvacuationResponse {
|
|||
Body body = 1;
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// AddChainLocalOverride request.
|
||||
message AddChainLocalOverrideRequest {
|
||||
message Body {
|
||||
// Container id for which the overrides are applied.
|
||||
bytes container_id = 1;
|
||||
|
||||
// Serialized rule chain.
|
||||
bytes chain = 2;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// AddChainLocalOverride response.
|
||||
message AddChainLocalOverrideResponse {
|
||||
message Body {
|
||||
// Chain ID assigned for the added rule chain.
|
||||
string chain_id = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// GetChainLocalOverride request.
|
||||
message GetChainLocalOverrideRequest {
|
||||
message Body {
|
||||
// Container id for which the overrides are defined.
|
||||
bytes container_id = 1;
|
||||
|
||||
// Chain ID assigned for the added rule chain.
|
||||
string chain_id = 2;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// GetChainLocalOverride response.
|
||||
message GetChainLocalOverrideResponse {
|
||||
message Body {
|
||||
// Serialized rule chain.
|
||||
bytes chain = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// ListChainLocalOverrides request.
|
||||
message ListChainLocalOverridesRequest {
|
||||
message Body {
|
||||
// Container id for which the overrides are defined.
|
||||
bytes container_id = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// ListChainLocalOverrides response.
|
||||
message ListChainLocalOverridesResponse {
|
||||
message Body {
|
||||
// The list of serialized rule chain.
|
||||
repeated bytes chains = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
message RemoveChainLocalOverrideRequest {
|
||||
message Body {
|
||||
// Container id for which the overrides are defined.
|
||||
bytes container_id = 1;
|
||||
|
||||
// Chain ID assigned for the added rule chain.
|
||||
string chain_id = 2;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
message RemoveChainLocalOverrideResponse {
|
||||
message Body {
|
||||
bool removed = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
|
BIN
pkg/services/control/service_frostfs.pb.go
generated
BIN
pkg/services/control/service_frostfs.pb.go
generated
Binary file not shown.
BIN
pkg/services/control/service_grpc.pb.go
generated
BIN
pkg/services/control/service_grpc.pb.go
generated
Binary file not shown.
Loading…
Reference in a new issue