Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Simpler status endpoint" #30

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions python_not_for_dunedaq/druncschema/controller_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 73 additions & 7 deletions python_not_for_dunedaq/druncschema/controller_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ def __init__(self, channel):
Args:
channel: A grpc.Channel.
"""
self.ls = channel.unary_unary(
'/dunedaq.druncschema.Controller/ls',
request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString,
response_deserializer=druncschema_dot_request__response__pb2.Response.FromString,
)
self.describe = channel.unary_unary(
'/dunedaq.druncschema.Controller/describe',
request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString,
response_deserializer=druncschema_dot_request__response__pb2.Response.FromString,
)
self.status = channel.unary_unary(
'/dunedaq.druncschema.Controller/status',
self.get_children_status = channel.unary_unary(
'/dunedaq.druncschema.Controller/get_children_status',
request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString,
response_deserializer=druncschema_dot_request__response__pb2.Response.FromString,
)
self.get_status = channel.unary_unary(
'/dunedaq.druncschema.Controller/get_status',
request_serializer=druncschema_dot_request__response__pb2.Request.SerializeToString,
response_deserializer=druncschema_dot_request__response__pb2.Response.FromString,
)
Expand Down Expand Up @@ -64,13 +74,25 @@ def __init__(self, channel):
class ControllerServicer(object):
"""Missing associated documentation comment in .proto file."""

def ls(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def describe(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def status(self, request, context):
def get_children_status(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def get_status(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
Expand Down Expand Up @@ -121,13 +143,23 @@ def who_is_in_charge(self, request, context):

def add_ControllerServicer_to_server(servicer, server):
rpc_method_handlers = {
'ls': grpc.unary_unary_rpc_method_handler(
servicer.ls,
request_deserializer=druncschema_dot_request__response__pb2.Request.FromString,
response_serializer=druncschema_dot_request__response__pb2.Response.SerializeToString,
),
'describe': grpc.unary_unary_rpc_method_handler(
servicer.describe,
request_deserializer=druncschema_dot_request__response__pb2.Request.FromString,
response_serializer=druncschema_dot_request__response__pb2.Response.SerializeToString,
),
'status': grpc.unary_unary_rpc_method_handler(
servicer.status,
'get_children_status': grpc.unary_unary_rpc_method_handler(
servicer.get_children_status,
request_deserializer=druncschema_dot_request__response__pb2.Request.FromString,
response_serializer=druncschema_dot_request__response__pb2.Response.SerializeToString,
),
'get_status': grpc.unary_unary_rpc_method_handler(
servicer.get_status,
request_deserializer=druncschema_dot_request__response__pb2.Request.FromString,
response_serializer=druncschema_dot_request__response__pb2.Response.SerializeToString,
),
Expand Down Expand Up @@ -176,6 +208,23 @@ def add_ControllerServicer_to_server(servicer, server):
class Controller(object):
"""Missing associated documentation comment in .proto file."""

@staticmethod
def ls(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dunedaq.druncschema.Controller/ls',
druncschema_dot_request__response__pb2.Request.SerializeToString,
druncschema_dot_request__response__pb2.Response.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def describe(request,
target,
Expand All @@ -194,7 +243,24 @@ def describe(request,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def status(request,
def get_children_status(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dunedaq.druncschema.Controller/get_children_status',
druncschema_dot_request__response__pb2.Request.SerializeToString,
druncschema_dot_request__response__pb2.Response.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def get_status(request,
target,
options=(),
channel_credentials=None,
Expand All @@ -204,7 +270,7 @@ def status(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dunedaq.druncschema.Controller/status',
return grpc.experimental.unary_unary(request, target, '/dunedaq.druncschema.Controller/get_status',
druncschema_dot_request__response__pb2.Request.SerializeToString,
druncschema_dot_request__response__pb2.Response.FromString,
options, channel_credentials,
Expand Down
19 changes: 18 additions & 1 deletion schema/druncschema/controller.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import "druncschema/request_response.proto";
import "google/protobuf/any.proto";

service Controller {
rpc ls (Request) returns (Response) {}
rpc describe (Request) returns (Response) {}
rpc status (Request) returns (Response) {}
rpc get_children_status (Request) returns (Response) {}
rpc get_status (Request) returns (Response) {}

rpc describe_fsm (Request) returns (Response) {}
rpc execute_fsm_command (Request) returns (Response) {}
Expand Down Expand Up @@ -40,6 +42,8 @@ message FSMCommandResponse{
google.protobuf.Any data = 3;
}



message Argument {
enum Presence{
MANDATORY = 0;
Expand Down Expand Up @@ -77,9 +81,22 @@ message FSMCommandsDescription {
}



message Status {
string name = 1;
string state = 2;
string sub_state = 3;
bool in_error = 4;
bool included = 5;
}

message ChildrenStatus {
repeated Status children_status = 1;
}

// message CommandResponse {
// Command command = 1;
// int32 command_code = 2;
// google.protobuf.Any payload = 3;
// }