xref: /aosp_15_r20/external/autotest/server/hosts/tls_client/autotest_common_pb2_grpc.py (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2import grpc
3from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
4
5import common
6from autotest_lib.server.hosts.tls_client import autotest_common_pb2 as autotest__common__pb2
7from autotest_lib.server.hosts.tls_client.dependencies.longrunning import operations_pb2 as dependencies_dot_longrunning_dot_operations__pb2
8
9class CommonStub(object):
10    """Common lab services implemented on top of the wiring APIs.
11
12  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
13  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
14  "OPTIONAL" in this document are to be interpreted as described in
15  RFC 2119.
16
17  All clients SHOULD pass the gRPC metadata key request_trace_id with one
18  value. The value is a unique string that is associated with the method call
19  in metrics. Clients that do not pass request_trace_id MAY be rejected so that
20  they can be fixed.
21  """
22
23    def __init__(self, channel):
24        """Constructor.
25
26    Args:
27      channel: A grpc.Channel.
28    """
29        self.ExecDutCommand = channel.unary_stream(
30            '/chromiumos.config.api.test.tls.Common/ExecDutCommand',
31            request_serializer=autotest__common__pb2.ExecDutCommandRequest.SerializeToString,
32            response_deserializer=autotest__common__pb2.ExecDutCommandResponse.FromString,
33            )
34        self.ProvisionDut = channel.unary_unary(
35            '/chromiumos.config.api.test.tls.Common/ProvisionDut',
36            request_serializer=autotest__common__pb2.ProvisionDutRequest.SerializeToString,
37            response_deserializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.FromString,
38            )
39        self.ProvisionLacros = channel.unary_unary(
40            '/chromiumos.config.api.test.tls.Common/ProvisionLacros',
41            request_serializer=autotest__common__pb2.ProvisionLacrosRequest.SerializeToString,
42            response_deserializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.FromString,
43            )
44        self.FetchCrashes = channel.unary_stream(
45            '/chromiumos.config.api.test.tls.Common/FetchCrashes',
46            request_serializer=autotest__common__pb2.FetchCrashesRequest.SerializeToString,
47            response_deserializer=autotest__common__pb2.FetchCrashesResponse.FromString,
48            )
49        self.CreateFakeOmaha = channel.unary_unary(
50            '/chromiumos.config.api.test.tls.Common/CreateFakeOmaha',
51            request_serializer=autotest__common__pb2.CreateFakeOmahaRequest.SerializeToString,
52            response_deserializer=autotest__common__pb2.FakeOmaha.FromString,
53            )
54        self.DeleteFakeOmaha = channel.unary_unary(
55            '/chromiumos.config.api.test.tls.Common/DeleteFakeOmaha',
56            request_serializer=autotest__common__pb2.DeleteFakeOmahaRequest.SerializeToString,
57            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
58            )
59
60
61class CommonServicer(object):
62    """Common lab services implemented on top of the wiring APIs.
63
64  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
65  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
66  "OPTIONAL" in this document are to be interpreted as described in
67  RFC 2119.
68
69  All clients SHOULD pass the gRPC metadata key request_trace_id with one
70  value. The value is a unique string that is associated with the method call
71  in metrics. Clients that do not pass request_trace_id MAY be rejected so that
72  they can be fixed.
73  """
74
75    def ExecDutCommand(self, request, context):
76        """ExecDutCommand runs a command on a DUT.
77
78    The working directory is /.
79    A tty is not spawned for the command.
80    The user and group is root.
81    All signals have their default dispositions and are not masked.
82    The umask is set to 0.
83
84    The environment contains:
85
86    TERM=dumb
87    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
88    LANG=en_US.UTF-8
89    USER=root
90    HOME=/root
91
92    The environment MAY also contain SSH client variables.
93    The environment SHALL NOT contain variables not mentioned above.
94
95    If the stream is interrupted, the implementation MAY attempt to
96    stop the command by sending SIGINT, SIGHUP, SIGTERM, or SIGKILL.
97    """
98        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
99        context.set_details('Method not implemented!')
100        raise NotImplementedError('Method not implemented!')
101
102    def ProvisionDut(self, request, context):
103        """ProvisionDut installs a specified version of ChromeOS on the DUT, along
104    with any specified DLCs.
105
106    If the DUT is already on the specified version of ChromeOS, the OS will
107    not be provisioned.
108
109    If the DUT already has the specified list of DLCs, only the missing DLCs
110    will be provisioned.
111    """
112        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
113        context.set_details('Method not implemented!')
114        raise NotImplementedError('Method not implemented!')
115
116    def ProvisionLacros(self, request, context):
117        """ProvisionLacros installs a specified version of Lacros on the DUT.
118
119    If the DUT already has the specified version of Lacros, Lacros will not be
120    provisioned.
121    """
122        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
123        context.set_details('Method not implemented!')
124        raise NotImplementedError('Method not implemented!')
125
126    def FetchCrashes(self, request, context):
127        """FetchCrashes gets a stream of all crash reports currently on the DUT.
128
129    The stream returned may split up a crash over multiple
130    `FetchCrashesResponse` protos. See the definition of that proto for
131    details.
132
133    This call is read-only: it doesn't delete the crashes that it reads.
134    """
135        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
136        context.set_details('Method not implemented!')
137        raise NotImplementedError('Method not implemented!')
138
139    def CreateFakeOmaha(self, request, context):
140        """CreateFakeOmaha starts a fake Omaha service on TLS and exposes the
141    listened port to the DUT.
142    """
143        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
144        context.set_details('Method not implemented!')
145        raise NotImplementedError('Method not implemented!')
146
147    def DeleteFakeOmaha(self, request, context):
148        """DeleteFakeOmaha deletes the specified fake Omaha resource created by
149    CreateFakeOmaha.
150    """
151        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
152        context.set_details('Method not implemented!')
153        raise NotImplementedError('Method not implemented!')
154
155
156def add_CommonServicer_to_server(servicer, server):
157    rpc_method_handlers = {
158        'ExecDutCommand': grpc.unary_stream_rpc_method_handler(
159            servicer.ExecDutCommand,
160            request_deserializer=autotest__common__pb2.ExecDutCommandRequest.FromString,
161            response_serializer=autotest__common__pb2.ExecDutCommandResponse.SerializeToString,
162        ),
163        'ProvisionDut': grpc.unary_unary_rpc_method_handler(
164            servicer.ProvisionDut,
165            request_deserializer=autotest__common__pb2.ProvisionDutRequest.FromString,
166            response_serializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
167        ),
168        'ProvisionLacros': grpc.unary_unary_rpc_method_handler(
169            servicer.ProvisionLacros,
170            request_deserializer=autotest__common__pb2.ProvisionLacrosRequest.FromString,
171            response_serializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
172        ),
173        'FetchCrashes': grpc.unary_stream_rpc_method_handler(
174            servicer.FetchCrashes,
175            request_deserializer=autotest__common__pb2.FetchCrashesRequest.FromString,
176            response_serializer=autotest__common__pb2.FetchCrashesResponse.SerializeToString,
177        ),
178        'CreateFakeOmaha': grpc.unary_unary_rpc_method_handler(
179            servicer.CreateFakeOmaha,
180            request_deserializer=autotest__common__pb2.CreateFakeOmahaRequest.FromString,
181            response_serializer=autotest__common__pb2.FakeOmaha.SerializeToString,
182        ),
183        'DeleteFakeOmaha': grpc.unary_unary_rpc_method_handler(
184            servicer.DeleteFakeOmaha,
185            request_deserializer=autotest__common__pb2.DeleteFakeOmahaRequest.FromString,
186            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
187        ),
188    }
189    generic_handler = grpc.method_handlers_generic_handler(
190        'chromiumos.config.api.test.tls.Common', rpc_method_handlers)
191    server.add_generic_rpc_handlers((generic_handler,))
192