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_pb2 as dmi_dot_hw__pb2 |
| 6 | from dmi import sw_image_pb2 as dmi_dot_sw__image__pb2 |
| 7 | from dmi import sw_management_service_pb2 as dmi_dot_sw__management__service__pb2 |
| 8 | |
| 9 | |
| 10 | class NativeSoftwareManagementServiceStub(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.GetSoftwareVersion = channel.unary_unary( |
| 20 | '/dmi.NativeSoftwareManagementService/GetSoftwareVersion', |
| 21 | request_serializer=dmi_dot_hw__pb2.HardwareID.SerializeToString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 22 | response_deserializer=dmi_dot_sw__management__service__pb2.GetSoftwareVersionInformationResponse.FromString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 23 | ) |
| 24 | self.DownloadImage = channel.unary_stream( |
| 25 | '/dmi.NativeSoftwareManagementService/DownloadImage', |
| 26 | request_serializer=dmi_dot_sw__management__service__pb2.DownloadImageRequest.SerializeToString, |
| 27 | response_deserializer=dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 28 | ) |
| 29 | self.ActivateImage = channel.unary_stream( |
| 30 | '/dmi.NativeSoftwareManagementService/ActivateImage', |
| 31 | request_serializer=dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 32 | response_deserializer=dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 33 | ) |
| 34 | self.RevertToStandbyImage = channel.unary_stream( |
| 35 | '/dmi.NativeSoftwareManagementService/RevertToStandbyImage', |
| 36 | request_serializer=dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 37 | response_deserializer=dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 38 | ) |
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 39 | self.UpdateStartupConfiguration = channel.unary_stream( |
| 40 | '/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration', |
| 41 | request_serializer=dmi_dot_sw__management__service__pb2.ConfigRequest.SerializeToString, |
| 42 | response_deserializer=dmi_dot_sw__management__service__pb2.ConfigResponse.FromString, |
| 43 | ) |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 44 | |
| 45 | |
| 46 | class NativeSoftwareManagementServiceServicer(object): |
| 47 | """Missing associated documentation comment in .proto file.""" |
| 48 | |
| 49 | def GetSoftwareVersion(self, request, context): |
| 50 | """Get the software version information of the Active and Standby images
|
| 51 | """ |
| 52 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 53 | context.set_details('Method not implemented!') |
| 54 | raise NotImplementedError('Method not implemented!') |
| 55 | |
| 56 | def DownloadImage(self, request, context): |
| 57 | """Downloads and installs the image in the standby partition, returns the status/progress of the Install
|
| 58 | """ |
| 59 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 60 | context.set_details('Method not implemented!') |
| 61 | raise NotImplementedError('Method not implemented!') |
| 62 | |
| 63 | def ActivateImage(self, request, context): |
| 64 | """Activates and runs the OLT with the image in the standby partition. If things are fine this image will
|
| 65 | henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
|
| 66 | Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
|
| 67 | """ |
| 68 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 69 | context.set_details('Method not implemented!') |
| 70 | raise NotImplementedError('Method not implemented!') |
| 71 | |
| 72 | def RevertToStandbyImage(self, request, context): |
| 73 | """Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 74 | This API is to be used if operator wants to go back to the previous software
|
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 75 | """ |
| 76 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 77 | context.set_details('Method not implemented!') |
| 78 | raise NotImplementedError('Method not implemented!') |
| 79 | |
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 80 | def UpdateStartupConfiguration(self, request, context): |
| 81 | """This API can be used to let the devices pickup their properitary configuration which they need at startup.
|
| 82 | """ |
| 83 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 84 | context.set_details('Method not implemented!') |
| 85 | raise NotImplementedError('Method not implemented!') |
| 86 | |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 87 | |
| 88 | def add_NativeSoftwareManagementServiceServicer_to_server(servicer, server): |
| 89 | rpc_method_handlers = { |
| 90 | 'GetSoftwareVersion': grpc.unary_unary_rpc_method_handler( |
| 91 | servicer.GetSoftwareVersion, |
| 92 | request_deserializer=dmi_dot_hw__pb2.HardwareID.FromString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 93 | response_serializer=dmi_dot_sw__management__service__pb2.GetSoftwareVersionInformationResponse.SerializeToString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 94 | ), |
| 95 | 'DownloadImage': grpc.unary_stream_rpc_method_handler( |
| 96 | servicer.DownloadImage, |
| 97 | request_deserializer=dmi_dot_sw__management__service__pb2.DownloadImageRequest.FromString, |
| 98 | response_serializer=dmi_dot_sw__image__pb2.ImageStatus.SerializeToString, |
| 99 | ), |
| 100 | 'ActivateImage': grpc.unary_stream_rpc_method_handler( |
| 101 | servicer.ActivateImage, |
| 102 | request_deserializer=dmi_dot_hw__pb2.HardwareID.FromString, |
| 103 | response_serializer=dmi_dot_sw__image__pb2.ImageStatus.SerializeToString, |
| 104 | ), |
| 105 | 'RevertToStandbyImage': grpc.unary_stream_rpc_method_handler( |
| 106 | servicer.RevertToStandbyImage, |
| 107 | request_deserializer=dmi_dot_hw__pb2.HardwareID.FromString, |
| 108 | response_serializer=dmi_dot_sw__image__pb2.ImageStatus.SerializeToString, |
| 109 | ), |
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 110 | 'UpdateStartupConfiguration': grpc.unary_stream_rpc_method_handler( |
| 111 | servicer.UpdateStartupConfiguration, |
| 112 | request_deserializer=dmi_dot_sw__management__service__pb2.ConfigRequest.FromString, |
| 113 | response_serializer=dmi_dot_sw__management__service__pb2.ConfigResponse.SerializeToString, |
| 114 | ), |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 115 | } |
| 116 | generic_handler = grpc.method_handlers_generic_handler( |
| 117 | 'dmi.NativeSoftwareManagementService', rpc_method_handlers) |
| 118 | server.add_generic_rpc_handlers((generic_handler,)) |
| 119 | |
| 120 | |
| 121 | # This class is part of an EXPERIMENTAL API. |
| 122 | class NativeSoftwareManagementService(object): |
| 123 | """Missing associated documentation comment in .proto file.""" |
| 124 | |
| 125 | @staticmethod |
| 126 | def GetSoftwareVersion(request, |
| 127 | target, |
| 128 | options=(), |
| 129 | channel_credentials=None, |
| 130 | call_credentials=None, |
| 131 | insecure=False, |
| 132 | compression=None, |
| 133 | wait_for_ready=None, |
| 134 | timeout=None, |
| 135 | metadata=None): |
| 136 | return grpc.experimental.unary_unary(request, target, '/dmi.NativeSoftwareManagementService/GetSoftwareVersion', |
| 137 | dmi_dot_hw__pb2.HardwareID.SerializeToString, |
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 138 | dmi_dot_sw__management__service__pb2.GetSoftwareVersionInformationResponse.FromString, |
uwe ottrembka | 5ea5c0a | 2020-08-31 10:37:35 +0200 | [diff] [blame] | 139 | options, channel_credentials, |
| 140 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 141 | |
| 142 | @staticmethod |
| 143 | def DownloadImage(request, |
| 144 | target, |
| 145 | options=(), |
| 146 | channel_credentials=None, |
| 147 | call_credentials=None, |
| 148 | insecure=False, |
| 149 | compression=None, |
| 150 | wait_for_ready=None, |
| 151 | timeout=None, |
| 152 | metadata=None): |
| 153 | return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/DownloadImage', |
| 154 | dmi_dot_sw__management__service__pb2.DownloadImageRequest.SerializeToString, |
| 155 | dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 156 | options, channel_credentials, |
| 157 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 158 | |
| 159 | @staticmethod |
| 160 | def ActivateImage(request, |
| 161 | target, |
| 162 | options=(), |
| 163 | channel_credentials=None, |
| 164 | call_credentials=None, |
| 165 | insecure=False, |
| 166 | compression=None, |
| 167 | wait_for_ready=None, |
| 168 | timeout=None, |
| 169 | metadata=None): |
| 170 | return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/ActivateImage', |
| 171 | dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 172 | dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 173 | options, channel_credentials, |
| 174 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 175 | |
| 176 | @staticmethod |
| 177 | def RevertToStandbyImage(request, |
| 178 | target, |
| 179 | options=(), |
| 180 | channel_credentials=None, |
| 181 | call_credentials=None, |
| 182 | insecure=False, |
| 183 | compression=None, |
| 184 | wait_for_ready=None, |
| 185 | timeout=None, |
| 186 | metadata=None): |
| 187 | return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/RevertToStandbyImage', |
| 188 | dmi_dot_hw__pb2.HardwareID.SerializeToString, |
| 189 | dmi_dot_sw__image__pb2.ImageStatus.FromString, |
| 190 | options, channel_credentials, |
| 191 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 192 | |
| 193 | @staticmethod |
| 194 | def UpdateStartupConfiguration(request, |
| 195 | target, |
| 196 | options=(), |
| 197 | channel_credentials=None, |
| 198 | call_credentials=None, |
| 199 | insecure=False, |
| 200 | compression=None, |
| 201 | wait_for_ready=None, |
| 202 | timeout=None, |
| 203 | metadata=None): |
| 204 | return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration', |
| 205 | dmi_dot_sw__management__service__pb2.ConfigRequest.SerializeToString, |
| 206 | dmi_dot_sw__management__service__pb2.ConfigResponse.FromString, |
| 207 | options, channel_credentials, |
| 208 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |