[#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:
Airat Arifullin 2023-10-31 18:36:42 +03:00 committed by Evgenii Stratonikov
parent 70ab1ebd54
commit 3a2c319b87
5 changed files with 138 additions and 0 deletions

View 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")
}

Binary file not shown.

View file

@ -44,6 +44,18 @@ service ControlService {
// Doctor performs storage restructuring operations on engine. // Doctor performs storage restructuring operations on engine.
rpc Doctor (DoctorRequest) returns (DoctorResponse); 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. // Health check request.
@ -405,3 +417,105 @@ message StopShardEvacuationResponse {
Body body = 1; Body body = 1;
Signature signature = 2; 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;
}

Binary file not shown.

Binary file not shown.