Martin Cosyns | 0efdc87 | 2021-09-27 16:24:30 +0000 | [diff] [blame] | 1 | # Copyright 2020-present Open Networking Foundation |
| 2 | # Original copyright 2020-present ADTRAN, Inc. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | import voltha_protos |
| 15 | |
| 16 | from robot.api.deco import keyword |
| 17 | from grpc_robot.grpc_robot import GrpcRobot |
| 18 | |
| 19 | |
| 20 | class GrpcVolthaRobot(GrpcRobot): |
| 21 | """ |
| 22 | This library is intended to supported different Protocol Buffer definitions. Precondition is that python files |
| 23 | generated from Protocol Buffer files are available in a pip package which must be installed before the library |
| 24 | is used. |
| 25 | |
| 26 | | Supported device | Pip package | Pip package version | Library Name | |
| 27 | | voltha | voltha-protos | 4.0.13 | grpc_robot.Voltha | |
| 28 | """ |
| 29 | |
| 30 | device = 'voltha' |
| 31 | package_name = 'voltha-protos' |
| 32 | installed_package = voltha_protos |
| 33 | |
| 34 | def __init__(self, **kwargs): |
| 35 | super().__init__(**kwargs) |
| 36 | |
| 37 | @keyword |
| 38 | def voltha_version_get(self): |
| 39 | """ |
| 40 | Retrieve the version of the currently used python module _voltha-protos_. |
| 41 | |
| 42 | *Return*: version string consisting of three dot-separated numbers (x.y.z) |
| 43 | """ |
| 44 | return self.pb_version |