uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
| 2 | """Client and server classes corresponding to protobuf-defined services.""" |
| 3 | import grpc |
| 4 | |
| 5 | from dmi import hw_metrics_mgmt_service_pb2 as dmi_dot_hw__metrics__mgmt__service__pb2 |
| 6 | from dmi import hw_pb2 as dmi_dot_hw__pb2 |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 7 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 8 | |
| 9 | |
| 10 | class NativeMetricsManagementServiceStub(object): |
| 11 | """Missing associated documentation comment in .proto file.""" |
| 12 | |
| 13 | def __init__(self, channel): |
| 14 | """Constructor. |
| 15 | |
| 16 | Args: |
| 17 | channel: A grpc.Channel. |
| 18 | """ |
| 19 | self.ListMetrics = channel.unary_unary( |
| 20 | '/dmi.NativeMetricsManagementService/ListMetrics', |
| 21 | request_serializer=dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 22 | response_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.ListMetricsResponse.FromString, |
| 23 | ) |
| 24 | self.UpdateMetricsConfiguration = channel.unary_unary( |
| 25 | '/dmi.NativeMetricsManagementService/UpdateMetricsConfiguration', |
| 26 | request_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationRequest.SerializeToString, |
| 27 | response_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationResponse.FromString, |
| 28 | ) |
| 29 | self.GetMetric = channel.unary_unary( |
| 30 | '/dmi.NativeMetricsManagementService/GetMetric', |
| 31 | request_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricRequest.SerializeToString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 32 | response_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricResponse.FromString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 33 | ) |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 34 | self.StreamMetrics = channel.unary_stream( |
| 35 | '/dmi.NativeMetricsManagementService/StreamMetrics', |
| 36 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| 37 | response_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.Metric.FromString, |
| 38 | ) |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 39 | |
| 40 | |
| 41 | class NativeMetricsManagementServiceServicer(object): |
| 42 | """Missing associated documentation comment in .proto file.""" |
| 43 | |
| 44 | def ListMetrics(self, request, context): |
| 45 | """List the supported metrics for the passed device.
|
| 46 | This would be the first call that you make to know about the metrics that a particular device supports and
|
| 47 | then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 48 | """ |
| 49 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 50 | context.set_details('Method not implemented!') |
| 51 | raise NotImplementedError('Method not implemented!') |
| 52 | |
| 53 | def UpdateMetricsConfiguration(self, request, context): |
| 54 | """Updates the configuration of the list of metrics in the request
|
| 55 | Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 56 | by changing its configuration.
|
| 57 |
|
| 58 | This configuration is persisted across restart of the device or the device manager
|
| 59 | """ |
| 60 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 61 | context.set_details('Method not implemented!') |
| 62 | raise NotImplementedError('Method not implemented!') |
| 63 | |
| 64 | def GetMetric(self, request, context): |
| 65 | """Get the instantenous value of a metric
|
| 66 | """ |
| 67 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 68 | context.set_details('Method not implemented!') |
| 69 | raise NotImplementedError('Method not implemented!') |
| 70 | |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 71 | def StreamMetrics(self, request, context): |
| 72 | """Initiate the server streaming of the metrics
|
| 73 | """ |
| 74 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 75 | context.set_details('Method not implemented!') |
| 76 | raise NotImplementedError('Method not implemented!') |
| 77 | |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 78 | |
| 79 | def add_NativeMetricsManagementServiceServicer_to_server(servicer, server): |
| 80 | rpc_method_handlers = { |
| 81 | 'ListMetrics': grpc.unary_unary_rpc_method_handler( |
| 82 | servicer.ListMetrics, |
| 83 | request_deserializer=dmi_dot_hw__pb2.HardwareID.FromString, |
| 84 | response_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.ListMetricsResponse.SerializeToString, |
| 85 | ), |
| 86 | 'UpdateMetricsConfiguration': grpc.unary_unary_rpc_method_handler( |
| 87 | servicer.UpdateMetricsConfiguration, |
| 88 | request_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationRequest.FromString, |
| 89 | response_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationResponse.SerializeToString, |
| 90 | ), |
| 91 | 'GetMetric': grpc.unary_unary_rpc_method_handler( |
| 92 | servicer.GetMetric, |
| 93 | request_deserializer=dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricRequest.FromString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 94 | response_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricResponse.SerializeToString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 95 | ), |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 96 | 'StreamMetrics': grpc.unary_stream_rpc_method_handler( |
| 97 | servicer.StreamMetrics, |
| 98 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, |
| 99 | response_serializer=dmi_dot_hw__metrics__mgmt__service__pb2.Metric.SerializeToString, |
| 100 | ), |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 101 | } |
| 102 | generic_handler = grpc.method_handlers_generic_handler( |
| 103 | 'dmi.NativeMetricsManagementService', rpc_method_handlers) |
| 104 | server.add_generic_rpc_handlers((generic_handler,)) |
| 105 | |
| 106 | |
| 107 | # This class is part of an EXPERIMENTAL API. |
| 108 | class NativeMetricsManagementService(object): |
| 109 | """Missing associated documentation comment in .proto file.""" |
| 110 | |
| 111 | @staticmethod |
| 112 | def ListMetrics(request, |
| 113 | target, |
| 114 | options=(), |
| 115 | channel_credentials=None, |
| 116 | call_credentials=None, |
| 117 | insecure=False, |
| 118 | compression=None, |
| 119 | wait_for_ready=None, |
| 120 | timeout=None, |
| 121 | metadata=None): |
| 122 | return grpc.experimental.unary_unary(request, target, '/dmi.NativeMetricsManagementService/ListMetrics', |
| 123 | dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 124 | dmi_dot_hw__metrics__mgmt__service__pb2.ListMetricsResponse.FromString, |
| 125 | options, channel_credentials, |
| 126 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 127 | |
| 128 | @staticmethod |
| 129 | def UpdateMetricsConfiguration(request, |
| 130 | target, |
| 131 | options=(), |
| 132 | channel_credentials=None, |
| 133 | call_credentials=None, |
| 134 | insecure=False, |
| 135 | compression=None, |
| 136 | wait_for_ready=None, |
| 137 | timeout=None, |
| 138 | metadata=None): |
| 139 | return grpc.experimental.unary_unary(request, target, '/dmi.NativeMetricsManagementService/UpdateMetricsConfiguration', |
| 140 | dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationRequest.SerializeToString, |
| 141 | dmi_dot_hw__metrics__mgmt__service__pb2.MetricsConfigurationResponse.FromString, |
| 142 | options, channel_credentials, |
| 143 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 144 | |
| 145 | @staticmethod |
| 146 | def GetMetric(request, |
| 147 | target, |
| 148 | options=(), |
| 149 | channel_credentials=None, |
| 150 | call_credentials=None, |
| 151 | insecure=False, |
| 152 | compression=None, |
| 153 | wait_for_ready=None, |
| 154 | timeout=None, |
| 155 | metadata=None): |
| 156 | return grpc.experimental.unary_unary(request, target, '/dmi.NativeMetricsManagementService/GetMetric', |
| 157 | dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricRequest.SerializeToString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 158 | dmi_dot_hw__metrics__mgmt__service__pb2.GetMetricResponse.FromString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 159 | options, channel_credentials, |
| 160 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 161 | |
| 162 | @staticmethod |
| 163 | def StreamMetrics(request, |
| 164 | target, |
| 165 | options=(), |
| 166 | channel_credentials=None, |
| 167 | call_credentials=None, |
| 168 | insecure=False, |
| 169 | compression=None, |
| 170 | wait_for_ready=None, |
| 171 | timeout=None, |
| 172 | metadata=None): |
| 173 | return grpc.experimental.unary_stream(request, target, '/dmi.NativeMetricsManagementService/StreamMetrics', |
| 174 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, |
| 175 | dmi_dot_hw__metrics__mgmt__service__pb2.Metric.FromString, |
| 176 | options, channel_credentials, |
| 177 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |