blob: 80bce7b22dbaea1a594e2158b31f8810a2a9b269 [file] [log] [blame]
Martin Cosyns0efdc872021-09-27 16:24:30 +00001# 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
14import voltha_protos
15
16from robot.api.deco import keyword
17from grpc_robot.grpc_robot import GrpcRobot
18
19
20class 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