aboutsummaryrefslogtreecommitdiff
path: root/server/hosts/tls_client/autotest_common_pb2_grpc.py
blob: 5bac36ae84468b95f6b16903f4c0591a959a30fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2

import common
from autotest_lib.server.hosts.tls_client import autotest_common_pb2 as autotest__common__pb2
from autotest_lib.server.hosts.tls_client.dependencies.longrunning import operations_pb2 as dependencies_dot_longrunning_dot_operations__pb2

class CommonStub(object):
    """Common lab services implemented on top of the wiring APIs.

  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
  "OPTIONAL" in this document are to be interpreted as described in
  RFC 2119.

  All clients SHOULD pass the gRPC metadata key request_trace_id with one
  value. The value is a unique string that is associated with the method call
  in metrics. Clients that do not pass request_trace_id MAY be rejected so that
  they can be fixed.
  """

    def __init__(self, channel):
        """Constructor.

    Args:
      channel: A grpc.Channel.
    """
        self.ExecDutCommand = channel.unary_stream(
            '/chromiumos.config.api.test.tls.Common/ExecDutCommand',
            request_serializer=autotest__common__pb2.ExecDutCommandRequest.SerializeToString,
            response_deserializer=autotest__common__pb2.ExecDutCommandResponse.FromString,
            )
        self.ProvisionDut = channel.unary_unary(
            '/chromiumos.config.api.test.tls.Common/ProvisionDut',
            request_serializer=autotest__common__pb2.ProvisionDutRequest.SerializeToString,
            response_deserializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.FromString,
            )
        self.ProvisionLacros = channel.unary_unary(
            '/chromiumos.config.api.test.tls.Common/ProvisionLacros',
            request_serializer=autotest__common__pb2.ProvisionLacrosRequest.SerializeToString,
            response_deserializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.FromString,
            )
        self.FetchCrashes = channel.unary_stream(
            '/chromiumos.config.api.test.tls.Common/FetchCrashes',
            request_serializer=autotest__common__pb2.FetchCrashesRequest.SerializeToString,
            response_deserializer=autotest__common__pb2.FetchCrashesResponse.FromString,
            )
        self.CreateFakeOmaha = channel.unary_unary(
            '/chromiumos.config.api.test.tls.Common/CreateFakeOmaha',
            request_serializer=autotest__common__pb2.CreateFakeOmahaRequest.SerializeToString,
            response_deserializer=autotest__common__pb2.FakeOmaha.FromString,
            )
        self.DeleteFakeOmaha = channel.unary_unary(
            '/chromiumos.config.api.test.tls.Common/DeleteFakeOmaha',
            request_serializer=autotest__common__pb2.DeleteFakeOmahaRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            )


class CommonServicer(object):
    """Common lab services implemented on top of the wiring APIs.

  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
  "OPTIONAL" in this document are to be interpreted as described in
  RFC 2119.

  All clients SHOULD pass the gRPC metadata key request_trace_id with one
  value. The value is a unique string that is associated with the method call
  in metrics. Clients that do not pass request_trace_id MAY be rejected so that
  they can be fixed.
  """

    def ExecDutCommand(self, request, context):
        """ExecDutCommand runs a command on a DUT.

    The working directory is /.
    A tty is not spawned for the command.
    The user and group is root.
    All signals have their default dispositions and are not masked.
    The umask is set to 0.

    The environment contains:

    TERM=dumb
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
    LANG=en_US.UTF-8
    USER=root
    HOME=/root

    The environment MAY also contain SSH client variables.
    The environment SHALL NOT contain variables not mentioned above.

    If the stream is interrupted, the implementation MAY attempt to
    stop the command by sending SIGINT, SIGHUP, SIGTERM, or SIGKILL.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ProvisionDut(self, request, context):
        """ProvisionDut installs a specified version of ChromeOS on the DUT, along
    with any specified DLCs.

    If the DUT is already on the specified version of ChromeOS, the OS will
    not be provisioned.

    If the DUT already has the specified list of DLCs, only the missing DLCs
    will be provisioned.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ProvisionLacros(self, request, context):
        """ProvisionLacros installs a specified version of Lacros on the DUT.

    If the DUT already has the specified version of Lacros, Lacros will not be
    provisioned.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def FetchCrashes(self, request, context):
        """FetchCrashes gets a stream of all crash reports currently on the DUT.

    The stream returned may split up a crash over multiple
    `FetchCrashesResponse` protos. See the definition of that proto for
    details.

    This call is read-only: it doesn't delete the crashes that it reads.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateFakeOmaha(self, request, context):
        """CreateFakeOmaha starts a fake Omaha service on TLS and exposes the
    listened port to the DUT.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteFakeOmaha(self, request, context):
        """DeleteFakeOmaha deletes the specified fake Omaha resource created by
    CreateFakeOmaha.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_CommonServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ExecDutCommand': grpc.unary_stream_rpc_method_handler(
            servicer.ExecDutCommand,
            request_deserializer=autotest__common__pb2.ExecDutCommandRequest.FromString,
            response_serializer=autotest__common__pb2.ExecDutCommandResponse.SerializeToString,
        ),
        'ProvisionDut': grpc.unary_unary_rpc_method_handler(
            servicer.ProvisionDut,
            request_deserializer=autotest__common__pb2.ProvisionDutRequest.FromString,
            response_serializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        'ProvisionLacros': grpc.unary_unary_rpc_method_handler(
            servicer.ProvisionLacros,
            request_deserializer=autotest__common__pb2.ProvisionLacrosRequest.FromString,
            response_serializer=dependencies_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        'FetchCrashes': grpc.unary_stream_rpc_method_handler(
            servicer.FetchCrashes,
            request_deserializer=autotest__common__pb2.FetchCrashesRequest.FromString,
            response_serializer=autotest__common__pb2.FetchCrashesResponse.SerializeToString,
        ),
        'CreateFakeOmaha': grpc.unary_unary_rpc_method_handler(
            servicer.CreateFakeOmaha,
            request_deserializer=autotest__common__pb2.CreateFakeOmahaRequest.FromString,
            response_serializer=autotest__common__pb2.FakeOmaha.SerializeToString,
        ),
        'DeleteFakeOmaha': grpc.unary_unary_rpc_method_handler(
            servicer.DeleteFakeOmaha,
            request_deserializer=autotest__common__pb2.DeleteFakeOmahaRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'chromiumos.config.api.test.tls.Common', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))