-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathods_external_data_pb2_grpc.py
222 lines (201 loc) · 9.32 KB
/
ods_external_data_pb2_grpc.py
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import ods_external_data_pb2 as ods__external__data__pb2
class ExternalDataReaderStub(object):
"""
EXD-API RPC service definition
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Open = channel.unary_unary(
'/ods.external_data.ExternalDataReader/Open',
request_serializer=ods__external__data__pb2.Identifier.SerializeToString,
response_deserializer=ods__external__data__pb2.Handle.FromString,
)
self.GetStructure = channel.unary_unary(
'/ods.external_data.ExternalDataReader/GetStructure',
request_serializer=ods__external__data__pb2.StructureRequest.SerializeToString,
response_deserializer=ods__external__data__pb2.StructureResult.FromString,
)
self.GetValues = channel.unary_unary(
'/ods.external_data.ExternalDataReader/GetValues',
request_serializer=ods__external__data__pb2.ValuesRequest.SerializeToString,
response_deserializer=ods__external__data__pb2.ValuesResult.FromString,
)
self.GetValuesEx = channel.unary_unary(
'/ods.external_data.ExternalDataReader/GetValuesEx',
request_serializer=ods__external__data__pb2.ValuesExRequest.SerializeToString,
response_deserializer=ods__external__data__pb2.ValuesExResult.FromString,
)
self.Close = channel.unary_unary(
'/ods.external_data.ExternalDataReader/Close',
request_serializer=ods__external__data__pb2.Handle.SerializeToString,
response_deserializer=ods__external__data__pb2.Empty.FromString,
)
class ExternalDataReaderServicer(object):
"""
EXD-API RPC service definition
"""
def Open(self, request, context):
"""
'OpenExternalData' opens the external data and will return a handle for further requests.
The external data provider will keep the resource open addressed by the handle until the
'Close' request.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetStructure(self, request, context):
"""
'GetStructure' method will allow to retrieve information about the structure of the external data.
This method is used by an import processor to create measurements, submatrices and localcolumns
accordingly in an ASAM ODS database.
The ASAM ODS server will use this information to retrieve data from the external data provider
on client request later on.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValues(self, request, context):
"""
'GetValues' reads external data via/like ASAM ODS data-read interface.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValuesEx(self, request, context):
"""
Reads external data like ASAM ODS valuematrix-read in submatrix mode.
With this method the channel names and/or data can be retrieved.
Channels are addressed using pattern matching their names
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Close(self, request, context):
"""
Close external data to free resources.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ExternalDataReaderServicer_to_server(servicer, server):
rpc_method_handlers = {
'Open': grpc.unary_unary_rpc_method_handler(
servicer.Open,
request_deserializer=ods__external__data__pb2.Identifier.FromString,
response_serializer=ods__external__data__pb2.Handle.SerializeToString,
),
'GetStructure': grpc.unary_unary_rpc_method_handler(
servicer.GetStructure,
request_deserializer=ods__external__data__pb2.StructureRequest.FromString,
response_serializer=ods__external__data__pb2.StructureResult.SerializeToString,
),
'GetValues': grpc.unary_unary_rpc_method_handler(
servicer.GetValues,
request_deserializer=ods__external__data__pb2.ValuesRequest.FromString,
response_serializer=ods__external__data__pb2.ValuesResult.SerializeToString,
),
'GetValuesEx': grpc.unary_unary_rpc_method_handler(
servicer.GetValuesEx,
request_deserializer=ods__external__data__pb2.ValuesExRequest.FromString,
response_serializer=ods__external__data__pb2.ValuesExResult.SerializeToString,
),
'Close': grpc.unary_unary_rpc_method_handler(
servicer.Close,
request_deserializer=ods__external__data__pb2.Handle.FromString,
response_serializer=ods__external__data__pb2.Empty.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ods.external_data.ExternalDataReader', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class ExternalDataReader(object):
"""
EXD-API RPC service definition
"""
@staticmethod
def Open(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, '/ods.external_data.ExternalDataReader/Open',
ods__external__data__pb2.Identifier.SerializeToString,
ods__external__data__pb2.Handle.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetStructure(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, '/ods.external_data.ExternalDataReader/GetStructure',
ods__external__data__pb2.StructureRequest.SerializeToString,
ods__external__data__pb2.StructureResult.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValues(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, '/ods.external_data.ExternalDataReader/GetValues',
ods__external__data__pb2.ValuesRequest.SerializeToString,
ods__external__data__pb2.ValuesResult.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValuesEx(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, '/ods.external_data.ExternalDataReader/GetValuesEx',
ods__external__data__pb2.ValuesExRequest.SerializeToString,
ods__external__data__pb2.ValuesExResult.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Close(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, '/ods.external_data.ExternalDataReader/Close',
ods__external__data__pb2.Handle.SerializeToString,
ods__external__data__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)