From 1af932a98b1f695604d38b06fc73c2ee80ba8cb8 Mon Sep 17 00:00:00 2001 From: Petro Bratash Date: Thu, 14 Apr 2022 20:09:37 +0300 Subject: [PATCH] [BFN] [202111] Updated platform plugins (#10422) * Ported platform from master Signed-off-by: Petro Bratash * [BFN] Updated x86_64-accton_as9516_32d-r0/platform.json * [BFN] Refactoring and adding some functions of Thermal class (set and get thresholds and etc.) * [BFN] Fix exception when fwutil run without sudo * Revert "[BFN] syncd-rpc build with thrift 0.14.1 (#9884)" This reverts commit bec35267cbf187c3a1238d5eeb2a6827074db4ab. * [BFN] Updated SDK to 20220127_sai_1.9.1 (#9870) Signed-off-by: Andriy Kokhan * [BFN] updated SDE packages for BFN platforms (#10512) Updated SDE packages for bfn platform - introduced X6 profile - fixes for drop counters - fixes for platform part Co-authored-by: Andriy Kokhan Co-authored-by: roman_savchuk --- .../newport/switch-tna-sai.conf | 27 +- .../x86_64-accton_as9516_32d-r0/platform.json | 243 +- .../platform_components.json | 16 +- .../pmon_daemon_control.json | 2 +- .../system_health_monitoring_config.json | 11 + .../thermal_thresholds.json | 61 + .../montara/switch-sai.conf | 34 - .../montara/switch-tna-sai.conf | 21 +- .../platform.json | 106 +- .../platform_components.json | 16 +- .../system_health_monitoring_config.json | 11 + .../thermal_thresholds.json | 64 + .../mavericks/switch-sai.conf | 34 - .../mavericks/switch-tna-sai.conf | 21 +- .../platform.json | 85 + .../system_health_monitoring_config.json | 11 + platform/barefoot/bfn-modules/debian/control | 2 +- platform/barefoot/bfn-modules/debian/rules | 2 +- platform/barefoot/bfn-platform.mk | 2 +- platform/barefoot/bfn-sai.mk | 2 +- .../barefoot/docker-syncd-bfn/Dockerfile.j2 | 1 + platform/barefoot/one-image.mk | 1 + platform/barefoot/platform-modules-accton.mk | 11 + platform/barefoot/rules.mk | 1 + .../debian/changelog | 11 + .../debian/compat | 1 + .../debian/control | 12 + .../debian/rules | 110 + ...ic-platform-accton-wedge100bf-32qs.install | 2 + .../wedge100bf-32qs/LICENSE | 15 + .../wedge100bf-32qs/MAINTAINERS | 3 + .../wedge100bf-32qs/README.md | 2 + .../wedge100bf-32qs/classes/__init__.py | 0 .../wedge100bf-32qs/conf/usb0 | 5 + .../wedge100bf-32qs/modules/Makefile | 0 .../wedge100bf-32qs/setup.py | 14 + .../wedge100bf-32qs/sonic_platform | 1 + .../wedge100bf-32qs/sonic_platform_setup.py | 32 + .../wedge100bf-32qs/utils/bf-fancontrol | 3 + .../wedge100bf-32qs/utils/sensors | 11 + .../debian/control | 2 +- .../debian/rules | 2 +- .../sonic_platform/chassis.py | 187 +- .../sonic_platform/component.py | 318 + .../sonic_platform/eeprom.py | 48 +- .../sonic_platform/fan.py | 105 + .../sonic_platform/fan_drawer.py | 138 +- .../sonic_platform/platform_thrift_client.py | 20 +- .../sonic_platform/platform_utils.py | 22 + .../pltfm_mgr_rpc/pltfm_mgr_rpc.py | 6397 +++++++++++++++-- .../sonic_platform/pltfm_mgr_rpc/ttypes.py | 655 +- .../sonic_platform/psu.py | 110 +- .../sonic_platform/sfp.py | 399 +- .../sonic_platform/thermal.py | 133 +- .../debian/control | 2 +- .../debian/rules | 8 +- .../sonic-platform-modules-bfn/debian/control | 2 +- .../sonic-platform-modules-bfn/debian/rules | 6 +- .../debian/control | 2 +- .../debian/rules | 2 +- 60 files changed, 8051 insertions(+), 1514 deletions(-) create mode 100644 device/barefoot/x86_64-accton_as9516_32d-r0/system_health_monitoring_config.json create mode 100644 device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json delete mode 100644 device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf create mode 100644 device/barefoot/x86_64-accton_wedge100bf_32x-r0/system_health_monitoring_config.json create mode 100644 device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json delete mode 100644 device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf create mode 100644 device/barefoot/x86_64-accton_wedge100bf_65x-r0/system_health_monitoring_config.json create mode 100644 platform/barefoot/platform-modules-accton.mk create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/changelog create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/compat create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/control create mode 100755 platform/barefoot/sonic-platform-modules-accton/debian/rules create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py create mode 120000 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors create mode 100644 platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py create mode 100644 platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan.py create mode 100644 platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf b/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf index cf6e445dba1a..2789eb0e2c0d 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino2", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -20,21 +12,28 @@ "agent0": "lib/platform/x86_64-accton_as9516bf_32d-r0/libpltfm_mgr.so", "p4_programs": [ { + "program-name": "switch", + "bfrt-config": "share/switch/bf-rt.json", "p4_pipelines": [ { "p4_pipeline_name": "pipe", "config": "share/switch/pipe/tofino2.bin", "context": "share/switch/pipe/context.json" } - ], - "program-name": "switch", - "sai": "lib/libsai.so", - "bfrt-config": "share/switch/bf-rt.json", + ], "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, "non_default_port_ppgs": 5 } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json index 2b67ee684d81..abd2fec0a303 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json @@ -1,203 +1,300 @@ { "chassis": { "name": "Newport", - "fans": [ - { - "name": "counter-rotating-fan-1" - }, - { - "name": "counter-rotating-fan-2" - }, + "components": [ { - "name": "counter-rotating-fan-3" + "name": "BIOS" }, { - "name": "counter-rotating-fan-4" - }, - { - "name": "counter-rotating-fan-5" - }, + "name": "BMC" + } + ], + "thermal_manager": false, + "fans": [ { - "name": "counter-rotating-fan-6" + "name": "counter-rotating-fan-1", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-2", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-3", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-4", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-5", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-6", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } } ], - "fan_drawers":[ + "fan_drawers": [ { - "name": "fantray", - "num_fans" : 6, + "name": "fantray-1", + "status_led": { + "controllable": false + }, "fans": [ { - "name": "counter-rotating-fan-1" + "name": "counter-rotating-fan-1", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-2" + "name": "counter-rotating-fan-2", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-3" + "name": "counter-rotating-fan-3", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-4" + "name": "counter-rotating-fan-4", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-5" + "name": "counter-rotating-fan-5", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-6" + "name": "counter-rotating-fan-6", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } } ] } ], "psus": [ { - "name": "psu-1" + "name": "psu-1", + "temperature": false }, { - "name": "psu-2" + "name": "psu-2", + "temperature": false } ], "thermals": [ { - "name": "tmp75-i2c-3-4b:switch-temp" + "name": "com_e_driver-i2c-4-33:cpu-temp" }, { "name": "com_e_driver-i2c-4-33:memory-temp" }, { - "name": "com_e_driver-i2c-4-33:cpu-temp" + "name": "psu_driver-i2c-7-59:psu2-temp1" }, { - "name": "coretemp-isa-0000:core-0" + "name": "psu_driver-i2c-7-59:psu2-temp2" }, { - "name": "coretemp-isa-0000:core-1" + "name": "psu_driver-i2c-7-59:psu2-temp3" }, { - "name": "coretemp-isa-0000:core-2" + "name": "psu_driver-i2c-7-5a:psu1-temp1" }, { - "name": "coretemp-isa-0000:core-3" + "name": "psu_driver-i2c-7-5a:psu1-temp2" }, { - "name": "coretemp-isa-0000:package-id-0" + "name": "psu_driver-i2c-7-5a:psu1-temp3" }, { - "name": "psu_driver-i2c-7-5a:psu1-temp1" + "name": "tmp75-i2c-3-48:chip-temp" }, { - "name": "psu_driver-i2c-7-5a:psu1-temp2" + "name": "tmp75-i2c-3-49:exhaust2-temp" }, { - "name": "psu_driver-i2c-7-5a:psu1-temp3" + "name": "tmp75-i2c-3-4a:exhaust-temp" + }, + { + "name": "tmp75-i2c-3-4b:intake-temp" + }, + { + "name": "tmp75-i2c-3-4c:tofino-temp" }, { - "name": "tmp75-i2c-3-4a:inlet-left-temp" + "name": "tmp75-i2c-3-4d:intake2-temp" }, { - "name": "tmp75-i2c-3-4c:inlet-right-temp" + "name": "coretemp-isa-0000:package-id-0" }, { - "name": "tmp75-i2c-3-4d:temp1" + "name": "coretemp-isa-0000:core-0" }, { - "name": "tmp75-i2c-3-48:outlet-middle-temp" + "name": "coretemp-isa-0000:core-1" }, { - "name": "tmp75-i2c-3-49:inlet-middle-temp" + "name": "coretemp-isa-0000:core-2" + }, + { + "name": "coretemp-isa-0000:core-3" } ], "sfps": [ { - "name": "Ethernet0" + "name": "sfp1" + }, + { + "name": "sfp2" }, { - "name": "Ethernet8" + "name": "sfp3" }, { - "name": "Ethernet16" + "name": "sfp4" }, { - "name": "Ethernet32" + "name": "sfp5" }, { - "name": "Ethernet40" + "name": "sfp6" }, { - "name": "Ethernet48" + "name": "sfp7" }, { - "name": "Ethernet56" + "name": "sfp8" }, { - "name": "Ethernet64" + "name": "sfp9" }, { - "name": "Ethernet72" + "name": "sfp10" }, { - "name": "Ethernet80" + "name": "sfp11" }, { - "name": "Ethernet88" + "name": "sfp12" }, { - "name": "Ethernet96" + "name": "sfp13" }, { - "name": "Ethernet104" + "name": "sfp14" }, { - "name": "Ethernet112" + "name": "sfp15" }, { - "name": "Ethernet120" + "name": "sfp16" }, { - "name": "Ethernet128" + "name": "sfp17" }, { - "name": "Ethernet136" + "name": "sfp18" }, { - "name": "Ethernet144" + "name": "sfp19" }, { - "name": "Ethernet152" + "name": "sfp20" }, { - "name": "Ethernet160" + "name": "sfp21" }, { - "name": "Ethernet168" + "name": "sfp22" }, { - "name": "Ethernet176" + "name": "sfp23" }, { - "name": "Ethernet184" + "name": "sfp24" }, { - "name": "Ethernet192" + "name": "sfp25" }, { - "name": "Ethernet200" + "name": "sfp26" }, { - "name": "Ethernet208" + "name": "sfp27" }, { - "name": "Ethernet216" + "name": "sfp28" }, { - "name": "Ethernet224" + "name": "sfp29" }, { - "name": "Ethernet232" + "name": "sfp30" }, { - "name": "Ethernet240" + "name": "sfp31" }, { - "name": "Ethernet248" + "name": "sfp32" } ] }, @@ -207,7 +304,7 @@ "lanes": "0,1,2,3,4,5,6,7", "breakout_modes": { "1x400G[200G]": ["Ethernet0"], - "2x200G[100G,40G]": ["Ethernet0, Ethernet4"], + "2x200G[100G,40G]": ["Ethernet0", "Ethernet4"], "4x100G[50G]": ["Ethernet0", "Ethernet2", "Ethernet4", "Ethernet6"], "8x50G[25G,10G]": ["Ethernet0", "Ethernet1", "Ethernet2", "Ethernet3", "Ethernet4", "Ethernet5", "Ethernet6", "Ethernet7"], "1x200G[100G,40G](4)+4x50G[25G,10G](4)": ["Ethernet0", "Ethernet4", "Ethernet5", "Ethernet6", "Ethernet7"], @@ -587,4 +684,4 @@ } } } -} \ No newline at end of file +} diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json index 43874566a3ad..118079de4696 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json @@ -1,8 +1,10 @@ -{ - "chassis": { - "Newport": { - "component": { - } - } - } +{ + "chassis": { + "Newport": { + "component": { + "BIOS": { }, + "BMC": { } + } + } + } } \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json index 1059cddb4fa2..a0431d47812a 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json @@ -4,6 +4,6 @@ "skip_thermalctld": false, "skip_ledd": true, "skip_xcvrd": false, - "skip_psud": true, + "skip_psud": false, "skip_syseepromd": false } diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/system_health_monitoring_config.json b/device/barefoot/x86_64-accton_as9516_32d-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..654d43d81096 --- /dev/null +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "orange_blink" + } +} diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json b/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json new file mode 100644 index 000000000000..451067eb603c --- /dev/null +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json @@ -0,0 +1,61 @@ +{ + "thermals": [ + { + "com_e_driver-i2c-4-33:cpu-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "com_e_driver-i2c-4-33:memory-temp" : [85.0, 75.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-48:chip-temp" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-49:exhaust2-temp" : [80.0, 70.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4a:exhaust-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4b:intake-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4c:tofino-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4d:intake2-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:package-id-0" : [80.0, 70.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-0" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-1" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-2" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-3" : [99.0, 89.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp2" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp3" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp2" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp3" : [60.0, 50.0, 11.0, 1.0] + } + ] +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf deleted file mode 100644 index fc224c9602e4..000000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf +++ /dev/null @@ -1,34 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "agent0": "lib/platform/x86_64-accton_wedge100bf_32x-r0/libpltfm_mgr.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf index 085a1b8dcdfc..dc6f78e0b1e7 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json index 825f60c604ae..5fee4f0eebaf 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json @@ -1,6 +1,14 @@ { "chassis": { "name": "Wedge100BF-32X-O-AC-F-BF", + "components": [ + { + "name": "BIOS" + }, + { + "name": "BMC" + } + ], "fans": [ { "name": "counter-rotating-fan-1" @@ -18,10 +26,9 @@ "name": "counter-rotating-fan-5" } ], - "fan_drawers":[ + "fan_drawers": [ { - "name": "fantray", - "num_fans" : 5, + "name": "fantray-1", "fans": [ { "name": "counter-rotating-fan-1" @@ -50,38 +57,41 @@ } ], "thermals": [ + { + "name": "com_e_driver-i2c-4-33:cpu-temp" + }, { "name": "com_e_driver-i2c-4-33:memory-temp" }, { - "name": "com_e_driver-i2c-4-33:cpu-temp" + "name": "psu_driver-i2c-7-59:psu2-temp1" }, { - "name": "pfe1100-i2c-7-59:temp1" + "name": "psu_driver-i2c-7-59:psu2-temp2" }, { - "name": "pfe1100-i2c-7-59:temp2" + "name": "psu_driver-i2c-7-5a:psu1-temp1" }, { - "name": "pfe1100-i2c-7-5a:temp1" + "name": "psu_driver-i2c-7-5a:psu1-temp2" }, { - "name": "pfe1100-i2c-7-5a:temp2" + "name": "tmp75-i2c-3-48:chip-temp" }, { - "name": "tmp75-i2c-3-48:outlet-middle-temp" + "name": "tmp75-i2c-3-49:exhaust2-temp" }, { - "name": "tmp75-i2c-3-49:inlet-middle-temp" + "name": "tmp75-i2c-3-4a:exhaust-temp" }, { - "name": "tmp75-i2c-3-4a:inlet-left-temp" + "name": "tmp75-i2c-3-4b:intake-temp" }, { - "name": "tmp75-i2c-3-4b:switch-temp" + "name": "tmp75-i2c-3-4c:tofino-temp" }, { - "name": "tmp75-i2c-3-4c:inlet-right-temp" + "name": "tmp75-i2c-3-4d:intake2-temp" }, { "name": "tmp75-i2c-8-48:outlet-right-temp" @@ -89,6 +99,9 @@ { "name": "tmp75-i2c-8-49:outlet-left-temp" }, + { + "name": "pch_haswell-virtual-0:temp1" + }, { "name": "coretemp-isa-0000:package-id-0" }, @@ -103,107 +116,104 @@ }, { "name": "coretemp-isa-0000:core-3" - }, - { - "name": "pch_haswell-virtual-0:temp1" } ], "sfps": [ { - "name": "Ethernet0" + "name": "sfp1" }, { - "name": "Ethernet4" + "name": "sfp2" }, { - "name": "Ethernet8" + "name": "sfp3" }, { - "name": "Ethernet12" + "name": "sfp4" }, { - "name": "Ethernet16" + "name": "sfp5" }, { - "name": "Ethernet20" + "name": "sfp6" }, { - "name": "Ethernet24" + "name": "sfp7" }, { - "name": "Ethernet28" + "name": "sfp8" }, { - "name": "Ethernet32" + "name": "sfp9" }, { - "name": "Ethernet36" + "name": "sfp10" }, { - "name": "Ethernet40" + "name": "sfp11" }, { - "name": "Ethernet44" + "name": "sfp12" }, { - "name": "Ethernet48" + "name": "sfp13" }, { - "name": "Ethernet52" + "name": "sfp14" }, { - "name": "Ethernet56" + "name": "sfp15" }, { - "name": "Ethernet60" + "name": "sfp16" }, { - "name": "Ethernet64" + "name": "sfp17" }, { - "name": "Ethernet68" + "name": "sfp18" }, { - "name": "Ethernet72" + "name": "sfp19" }, { - "name": "Ethernet76" + "name": "sfp20" }, { - "name": "Ethernet80" + "name": "sfp21" }, { - "name": "Ethernet84" + "name": "sfp22" }, { - "name": "Ethernet88" + "name": "sfp23" }, { - "name": "Ethernet92" + "name": "sfp24" }, { - "name": "Ethernet96" + "name": "sfp25" }, { - "name": "Ethernet100" + "name": "sfp26" }, { - "name": "Ethernet104" + "name": "sfp27" }, { - "name": "Ethernet108" + "name": "sfp28" }, { - "name": "Ethernet112" + "name": "sfp29" }, { - "name": "Ethernet116" + "name": "sfp30" }, { - "name": "Ethernet120" + "name": "sfp31" }, { - "name": "Ethernet124" + "name": "sfp32" } ] }, diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json index df77fa3e1bf9..30befc827a9e 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json @@ -1,8 +1,10 @@ -{ - "chassis": { - "Wedge100BF-32X-O-AC-F-BF": { - "component": { - } - } - } +{ + "chassis": { + "Wedge100BF-32X-O-AC-F-BF": { + "component": { + "BIOS": { }, + "BMC": { } + } + } + } } \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/system_health_monitoring_config.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..654d43d81096 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "orange_blink" + } +} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json new file mode 100644 index 000000000000..bee961a84411 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json @@ -0,0 +1,64 @@ +{ + "thermals": [ + { + "com_e_driver-i2c-4-33:cpu-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "com_e_driver-i2c-4-33:memory-temp" : [85.0, 75.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp1" : [50.0, 40.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp2" : [90.0, 80.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp1" : [50.0, 40.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp2" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-48:chip-temp" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-49:exhaust2-temp" : [80.0, 70.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4a:exhaust-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4b:intake-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4c:tofino-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4d:intake2-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-8-48:outlet-right-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-8-49:outlet-left-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "pch_haswell-virtual-0:temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:package-id-0" : [80.0, 70.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-0" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-1" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-2" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-3" : [99.0, 89.0, 11.0, 1.0] + } + ] +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf deleted file mode 100644 index 81a7d7bc28c3..000000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf +++ /dev/null @@ -1,34 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "agent0": "lib/platform/x86_64-accton_wedge100bf_65x-r0/libpltfm_mgr.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf index ddcb9d4ba287..e07192619af0 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json index a2394135c0fc..73bb6008dbba 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json @@ -1,4 +1,89 @@ { + "chassis": { + "name": "Mavericks", + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + }, + { + "name": "counter-rotating-fan-6" + }, + { + "name": "counter-rotating-fan-7" + }, + { + "name": "counter-rotating-fan-8" + }, + { + "name": "counter-rotating-fan-9" + }, + { + "name": "counter-rotating-fan-10" + } + ], + "fan_drawers": [ + { + "name": "fantray-1", + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + } + ] + }, + { + "name": "fantray-2", + "fans": [ + { + "name": "counter-rotating-fan-6" + }, + { + "name": "counter-rotating-fan-7" + }, + { + "name": "counter-rotating-fan-8" + }, + { + "name": "counter-rotating-fan-9" + }, + { + "name": "counter-rotating-fan-10" + } + ] + } + ] + }, + "psus": [ + { + "name": "psu-1" + }, + { + "name": "psu-2" + } + ], "interfaces": { "Ethernet0": { "index": "1,1,1,1", diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/system_health_monitoring_config.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..654d43d81096 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "orange_blink" + } +} diff --git a/platform/barefoot/bfn-modules/debian/control b/platform/barefoot/bfn-modules/debian/control index 88c1e9458862..9023bdd63474 100644 --- a/platform/barefoot/bfn-modules/debian/control +++ b/platform/barefoot/bfn-modules/debian/control @@ -2,7 +2,7 @@ Source: bfn-modules Section: main Priority: extra Maintainer: support -Build-Depends: debhelper (>= 8.0.0), bzip2 +Build-Depends: debhelper (>= 8.0.0), bzip2, python3 Standards-Version: 3.9.3 Package: bfn-modules diff --git a/platform/barefoot/bfn-modules/debian/rules b/platform/barefoot/bfn-modules/debian/rules index c588b075e5e7..ca467222d4a6 100755 --- a/platform/barefoot/bfn-modules/debian/rules +++ b/platform/barefoot/bfn-modules/debian/rules @@ -8,7 +8,7 @@ KERNEL_SRC := /lib/modules/$(KVERSION) MODULE_SRC := $(shell pwd)/modules %: - dh $@ + dh $@ --with python3 override_dh_auto_build: make -C $(KERNEL_SRC)/build M=$(MODULE_SRC) diff --git a/platform/barefoot/bfn-platform.mk b/platform/barefoot/bfn-platform.mk index 6e7960277265..f12bbaa8a966 100644 --- a/platform/barefoot/bfn-platform.mk +++ b/platform/barefoot/bfn-platform.mk @@ -1,4 +1,4 @@ -BFN_PLATFORM = bfnplatform_20211117_sai_1.9.1_deb10.deb +BFN_PLATFORM = bfnplatform_20220408_sai_1.9.1_deb10.deb $(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_PLATFORM)" SONIC_ONLINE_DEBS += $(BFN_PLATFORM) diff --git a/platform/barefoot/bfn-sai.mk b/platform/barefoot/bfn-sai.mk index 4129dc8530c7..a0a1d2348dea 100644 --- a/platform/barefoot/bfn-sai.mk +++ b/platform/barefoot/bfn-sai.mk @@ -1,4 +1,4 @@ -BFN_SAI = bfnsdk_20211117_sai_1.9.1_deb10.deb +BFN_SAI = bfnsdk_20220408_sai_1.9.1_deb10.deb $(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_SAI)" $(BFN_SAI)_DEPENDS += $(LIBNL_GENL3_DEV) diff --git a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 index 7071b0c8b51e..e085ef130aed 100755 --- a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 @@ -22,6 +22,7 @@ RUN apt-get install -y \ libunwind8-dev \ libpython3.4 \ libc-ares2 \ + libedit2 \ libgoogle-perftools4 RUN dpkg -i \ diff --git a/platform/barefoot/one-image.mk b/platform/barefoot/one-image.mk index 8ed212c6f7a8..a4565b47916b 100644 --- a/platform/barefoot/one-image.mk +++ b/platform/barefoot/one-image.mk @@ -12,6 +12,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_NEWPORT_BF_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9180_32X_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9280_64X_PLATFORM_MODULE) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_QS_PLATFORM_MODULE) ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) diff --git a/platform/barefoot/platform-modules-accton.mk b/platform/barefoot/platform-modules-accton.mk new file mode 100644 index 000000000000..077c23d7bfd6 --- /dev/null +++ b/platform/barefoot/platform-modules-accton.mk @@ -0,0 +1,11 @@ +# BFN Platform modules + +BFN_MONTARA_QS_PLATFORM_MODULE_VERSION = 1.1 + +export BFN_MONTARA_QS_PLATFORM_MODULE_VERSION + +BFN_MONTARA_QS_PLATFORM_MODULE = sonic-platform-accton-wedge100bf-32qs_$(BFN_MONTARA_QS_PLATFORM_MODULE_VERSION)_amd64.deb +$(BFN_MONTARA_QS_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton +$(BFN_MONTARA_QS_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(BFN_MONTARA_QS_PLATFORM_MODULE)_PLATFORM = x86_64-accton_wedge100bf_32qs-r0 +SONIC_DPKG_DEBS += $(BFN_MONTARA_QS_PLATFORM_MODULE) diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index 98dcef0f7b8a..7f7735b03b51 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -1,6 +1,7 @@ include $(PLATFORM_PATH)/platform-modules-arista.mk include $(PLATFORM_PATH)/platform-modules-bfn.mk include $(PLATFORM_PATH)/platform-modules-bfn-montara.mk +include $(PLATFORM_PATH)/platform-modules-accton.mk include $(PLATFORM_PATH)/platform-modules-bfn-newport.mk include $(PLATFORM_PATH)/platform-modules-wnc-osw1800.mk include $(PLATFORM_PATH)/platform-modules-ingrasys.mk diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/changelog b/platform/barefoot/sonic-platform-modules-accton/debian/changelog new file mode 100644 index 000000000000..8cbad8e1f551 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/changelog @@ -0,0 +1,11 @@ +sonic-accton-platform-modules (1.1) unstable; urgency=low + + * Remove bfn asic kernel modules from platform package + + -- Support Mon, 22 Oct 2018 15:40:00 -0800 + +sonic-accton-platform-modules (1.0) unstable; urgency=low + + * Initial release + + -- Support Mon, 11 Nov 2015 11:11:11 -0800 diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/compat b/platform/barefoot/sonic-platform-modules-accton/debian/compat new file mode 100644 index 000000000000..ec635144f600 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/control b/platform/barefoot/sonic-platform-modules-accton/debian/control new file mode 100644 index 000000000000..ba76bc7cfa3f --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/control @@ -0,0 +1,12 @@ +Source: sonic-accton-platform-modules +Section: main +Priority: extra +Maintainer: Support +Build-Depends: debhelper (>= 9.0.0), bzip2 +Standards-Version: 3.9.3 + +Package: sonic-platform-accton-wedge100bf-32qs +Architecture: amd64 +Depends: linux-image-4.19.0-12-2-amd64-unsigned +Description: kernel modules for platform devices such as fan, led, sfp + diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/rules b/platform/barefoot/sonic-platform-modules-accton/debian/rules new file mode 100755 index 000000000000..35fdb0d5bdbe --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/rules @@ -0,0 +1,110 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +include /usr/share/dpkg/pkg-info.mk + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export INSTALL_MOD_DIR:=extra + +PYTHON ?= python2 +PYTHON3 ?= python3 + +PACKAGE_PRE_NAME := sonic-platform-accton +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIRS := wedge100bf-32qs +MODULE_DIR := modules +UTILS_DIR := utils +SERVICE_DIR := service +CONF_DIR := conf + +%: + dh $@ --with systemd,python2,python3 --buildsystem=pybuild + +clean: + dh_testdir + dh_testroot + dh_clean + +build: + #make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC) + (for mod in $(MODULE_DIRS); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ + $(PYTHON) $${mod}/setup.py build; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + if [ -f sonic_platform_setup.py ]; then \ + $(PYTHON3) sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ + echo "Finished makig whl package for $$mod"; \ + fi; \ + cd $(MOD_SRC_DIR); \ + done) + +binary: binary-arch binary-indep + # Nothing to do + +binary-arch: + # Nothing to do + +#install: build + #dh_testdir + #dh_testroot + #dh_clean -k + #dh_installdirs + +binary-indep: + dh_testdir + dh_installdirs + + # Custom package commands + (for mod in $(MODULE_DIRS); do \ + if [ -d $${mod}/$(MODULE_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + fi; \ + if [ -d $${mod}/$(UTILS_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /usr/local/bin; \ + cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ + fi; \ + if [ -d $${mod}/$(SERVICE_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /lib/systemd/system; \ + cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ + fi; \ + if [ -f $${mod}/setup.py ]; then \ + $(PYTHON) $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ + fi; \ + if [ -f $${mod}/sonic_platform_setup.py ]; then \ + cd $(MOD_SRC_DIR)/$${mod}; \ + $(PYTHON3) sonic_platform_setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ + echo "Insalled whl package for $$mod"; \ + cd $(MOD_SRC_DIR); \ + fi; \ + if [ $$mod = "wedge100bf-32qs" ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} etc/network/interfaces.d; \ + cp $(MOD_SRC_DIR)/$${mod}/$(CONF_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/etc/network/interfaces.d; \ + fi; \ + done) + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +.PHONY: build binary binary-arch binary-indep clean \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install b/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install new file mode 100644 index 000000000000..8a5e4a4bd64e --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install @@ -0,0 +1,2 @@ +wedge100bf-32qs/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_wedge100bf_32qs-r0 + diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE new file mode 100644 index 000000000000..676cdeec726b --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE @@ -0,0 +1,15 @@ +Copyright (C) 2016 Microsoft, Inc + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS new file mode 100644 index 000000000000..3e69704ff6dd --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS @@ -0,0 +1,3 @@ +# This file describes the maintainers for wedge100bf-32qs +# See the SONiC project governance document for more information +Mailinglist = sonicproject@googlegroups.com diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md new file mode 100644 index 000000000000..17d59593fbfb --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md @@ -0,0 +1,2 @@ +# wedge100bf-32qs +Device drivers for support of BFN platform for the SONiC project diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 new file mode 100644 index 000000000000..f1dd054cc6f6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 @@ -0,0 +1,5 @@ +# BMC interface +auto usb0 +allow-hotplug usb0 +iface usb0 inet6 +up ifconfig usb0 txqueuelen 64 diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py new file mode 100755 index 000000000000..2c151a8a7bdd --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='wedge100bf-32qs', + version='1.0', + description='Module to initialize Accton wedge100bf-32qs platforms', + + packages=['wedge100bf-32qs'], + package_dir={'wedge100bf-32qs': 'wedge100bf-32qs/classes'}, +) diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform new file mode 120000 index 000000000000..7d33d95d18bc --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform @@ -0,0 +1 @@ +../../sonic-platform-modules-bfn-montara/sonic_platform/ \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py new file mode 100644 index 000000000000..14e1bb6b6c02 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py @@ -0,0 +1,32 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation', + license='Apache 2.0', + author='SONiC Team', + author_email='', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Barefoot', + maintainer_email='', + packages=[ + 'sonic_platform', + 'sonic_platform/pltfm_mgr_rpc', + 'sonic_platform/bfn_extensions', + ], + package_data = {'sonic_platform':['logging.conf']}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol new file mode 100755 index 000000000000..7407c2d7241d --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 -m sonic_platform.bfn_extensions.platform_fancontrol "$@" diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors new file mode 100755 index 000000000000..5f06a9c99b05 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors @@ -0,0 +1,11 @@ +#!/bin/bash + +DOCKER_EXEC_FLAGS="i" + +# Determine whether stdout is on a terminal +if [ -t 1 ] ; then + DOCKER_EXEC_FLAGS+="t" +fi + +python3 -m sonic_platform.bfn_extensions.platform_sensors "$@" +docker exec -$DOCKER_EXEC_FLAGS pmon sensors "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control index ebafd6a52ba1..5c5d58b9bd53 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control @@ -2,7 +2,7 @@ Source: sonic-platform-modules-bfn-montara Section: main Priority: extra Maintainer: Support -Build-Depends: debhelper (>= 9.0.0), bzip2 +Build-Depends: debhelper (>= 9.0.0), bzip2, python3 Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn-montara diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules index 32036bb90803..5e14ab42f75d 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules @@ -8,7 +8,7 @@ BUILD_DIR := $(shell pwd)/build WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel %: - dh $@ + dh $@ --with python3 --buildsystem=pybuild override_dh_auto_build: set -e diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py index 319d29ef1727..6d0e8b8c120c 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py @@ -1,29 +1,62 @@ #!/usr/bin/env python try: - import sys + import os + import time + import syslog + import logging + import logging.config + import yaml + from sonic_platform_base.chassis_base import ChassisBase - from sonic_platform.sfp import Sfp, sfp_list_get + from sonic_platform.sfp import Sfp from sonic_platform.psu import psu_list_get from sonic_platform.fan_drawer import fan_drawer_list_get from sonic_platform.thermal import thermal_list_get from eeprom import Eeprom + from platform_utils import file_create + + from sonic_platform.platform_thrift_client import pltfm_mgr_ready + from sonic_platform.platform_thrift_client import thrift_try + + from sonic_py_common import device_info + except ImportError as e: raise ImportError(str(e) + "- required module not found") +NUM_COMPONENT = 2 class Chassis(ChassisBase): """ Platform-specific Chassis class """ + + PORT_START = 1 + PORT_END = 0 + PORTS_IN_BLOCK = 0 + QSFP_PORT_START = 1 + QSFP_PORT_END = 0 + QSFP_CHECK_INTERVAL = 4 + def __init__(self): ChassisBase.__init__(self) self.__eeprom = None self.__fan_drawers = None + self.__fan_list = None self.__thermals = None self.__psu_list = None self.__sfp_list = None + self.ready = False + self.phy_port_cur_state = {} + self.qsfp_interval = self.QSFP_CHECK_INTERVAL + self.__initialize_components() + + with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f: + config_dict = yaml.load(f, yaml.SafeLoader) + file_create(config_dict['handlers']['file']['filename'], '646') + logging.config.dictConfig(config_dict) + @property def _eeprom(self): if self.__eeprom is None: @@ -44,6 +77,18 @@ def _fan_drawer_list(self): def _fan_drawer_list(self, value): pass + @property + def _fan_list(self): + if self.__fan_list is None: + self.__fan_list = [] + for fan_drawer in self._fan_drawer_list: + self.__fan_list.extend(fan_drawer._fan_list) + return self.__fan_list + + @_fan_list.setter + def _fan_list(self, value): + pass + @property def _thermal_list(self): if self.__thermals is None: @@ -67,13 +112,40 @@ def _psu_list(self, value): @property def _sfp_list(self): if self.__sfp_list is None: - self.__sfp_list = sfp_list_get() + self.__update_port_info() + self.__sfp_list = [] + for index in range(self.PORT_START, self.PORT_END + 1): + sfp_node = Sfp(index) + self.__sfp_list.append(sfp_node) return self.__sfp_list @_sfp_list.setter def _sfp_list(self, value): pass + def __update_port_info(self): + def qsfp_max_port_get(client): + return client.pltfm_mgr.pltfm_mgr_qsfp_get_max_port() + + if self.QSFP_PORT_END == 0: + platform = device_info.get_platform() + self.QSFP_PORT_END = thrift_try(qsfp_max_port_get) + exclude_cpu_port = [ + "x86_64-accton_as9516_32d-r0", + "x86_64-accton_as9516bf_32d-r0", + "x86_64-accton_wedge100bf_32x-r0" + ] + if platform in exclude_cpu_port: + self.QSFP_PORT_END -= 1 + self.PORT_END = self.QSFP_PORT_END + self.PORTS_IN_BLOCK = self.QSFP_PORT_END + + def __initialize_components(self): + from sonic_platform.component import Components + for index in range(0, NUM_COMPONENT): + component = Components(index) + self._component_list.append(component) + def get_name(self): """ Retrieves the name of the chassis @@ -106,6 +178,14 @@ def get_serial(self): """ return self._eeprom.serial_number_str() + def get_revision(self): + """ + Retrieves the revision number of the chassis (Service tag) + Returns: + string: Revision number of chassis + """ + return self._eeprom.revision_str() + def get_sfp(self, index): """ Retrieves sfp represented by (1-based) index @@ -124,7 +204,7 @@ def get_sfp(self, index): try: sfp = self._sfp_list[index-1] except IndexError: - sys.stderr.write("SFP index {} out of range (1-{})\n".format( + syslog.syslog(syslog.LOG_ERR, "SFP index {} out of range (1-{})\n".format( index, len(self._sfp_list)-1)) return sfp @@ -158,8 +238,60 @@ def get_system_eeprom_info(self): """ return self._eeprom.system_eeprom_info() + def __get_transceiver_change_event(self, timeout=0): + forever = False + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + syslog.syslog(syslog.LOG_ERR, "Invalid timeout value {}".format(timeout)) + return False, {} + + phy_port_dict = {} if self.ready else {'-1': 'system_not_ready'} + + while forever or timeout > 0: + if not self.ready: + if pltfm_mgr_ready(): + self.ready = True + phy_port_dict = {} + + if self.ready and self.qsfp_interval == 0: + self.qsfp_interval = self.QSFP_CHECK_INTERVAL + + # Get presence of each SFP + for port in range(self.PORT_START, self.PORT_END + 1): + try: + sfp_resent = self.get_sfp(port).get_presence() + except Exception: + sfp_resent = False + sfp_state = '1' if sfp_resent else '0' + + if port in self.phy_port_cur_state: + if self.phy_port_cur_state[port] != sfp_state: + phy_port_dict[port] = sfp_state + else: + phy_port_dict[port] = sfp_state + + # Update port current state + self.phy_port_cur_state[port] = sfp_state + + # Break if tranceiver state has changed + if phy_port_dict: + break + + if timeout: + timeout -= 1 + + if self.qsfp_interval: + self.qsfp_interval -= 1 + + time.sleep(1) + + return self.ready, phy_port_dict + def get_change_event(self, timeout=0): - ready, event_sfp = Sfp.get_transceiver_change_event(timeout) + ready, event_sfp = self.__get_transceiver_change_event(timeout) return ready, { 'sfp': event_sfp } if ready else {} def get_reboot_cause(self): @@ -174,3 +306,48 @@ def get_reboot_cause(self): to pass a description of the reboot cause. """ return self.REBOOT_CAUSE_NON_HARDWARE, '' + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def initizalize_system_led(self): + self.system_led = "" + return True + + def set_status_led(self, color): + """ + Sets the state of the system LED + + Args: + color: A string representing the color with which to set the + system LED + + Returns: + bool: True if system LED state is set successfully, False if not + """ + self.system_led = color + return True + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + return self.system_led diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py new file mode 100644 index 000000000000..47a0993bf3e5 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py @@ -0,0 +1,318 @@ +try: + import os + import subprocess + from sonic_platform_base.component_base import ComponentBase + from platform_thrift_client import thrift_try + import json + from collections import OrderedDict + from sonic_py_common import device_info + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def get_bios_version(): + """ + Retrieves the firmware version of the BIOS + Returns: + A string containing the firmware version of the BIOS + """ + try: + cmd = ['dmidecode', '-s', 'bios-version'] + if os.geteuid() != 0: + cmd.insert(0, 'sudo') + return subprocess.check_output(cmd).strip().decode() + except subprocess.CalledProcessError as e: + raise RuntimeError("Failed to get BIOS version") + +def get_bmc_version(): + """ + Retrieves the firmware version of the BMC + Returns: + A string containing the firmware version of the BMC + """ + ver = "N/A" + def bmc_get(client): + return client.pltfm_mgr.pltfm_mgr_chss_mgmt_bmc_ver_get() + try: + ver = thrift_try(bmc_get) + except Exception: + pass + + return ver + +class BFPlatformComponentsParser(object): + """ + BFPlatformComponentsParser + """ + CHASSIS_KEY = "chassis" + MODULE_KEY = "module" + COMPONENT_KEY = "component" + FIRMWARE_KEY = "firmware" + + def __init__(self, platform_components_path): + self.__chassis_component_map = OrderedDict() + self.__component_list = [] + self.__bf_model = "" + self.__parse_platform_components(platform_components_path) + + def __is_str(self, obj): + return isinstance(obj, str) + + def __is_dict(self, obj): + return isinstance(obj, dict) + + def __parser_fail(self, msg): + raise RuntimeError("Failed to parse \"{}\": {}".format(PLATFORM_COMPONENTS_FILE, msg)) + + def __parser_platform_fail(self, msg): + self.__parser_fail("invalid platform schema: {}".format(msg)) + + def __parser_chassis_fail(self, msg): + self.__parser_fail("invalid chassis schema: {}".format(msg)) + + def __parser_component_fail(self, msg): + self.__parser_fail("invalid component schema: {}".format(msg)) + + def __parse_component_section(self, section, component, is_module_component=False): + if not self.__is_dict(component): + self.__parser_component_fail("dictionary is expected: key={}".format(self.COMPONENT_KEY)) + + if not component: + return + + missing_key = None + + for key1, value1 in component.items(): + if not self.__is_dict(value1): + self.__parser_component_fail("dictionary is expected: key={}".format(key1)) + + self.__chassis_component_map[section][key1] = OrderedDict() + + if value1: + if len(value1) < 1 or len(value1) > 3: + self.__parser_component_fail("unexpected number of records: key={}".format(key1)) + + if self.FIRMWARE_KEY not in value1: + missing_key = self.FIRMWARE_KEY + break + + for key2, value2 in value1.items(): + if not self.__is_str(value2): + self.__parser_component_fail("string is expected: key={}".format(key2)) + + self.__chassis_component_map[section][key1] = value1 + + if missing_key is not None: + self.__parser_component_fail("\"{}\" key hasn't been found".format(missing_key)) + + def __parse_chassis_section(self, chassis): + self.__chassis_component_map = OrderedDict() + + if not self.__is_dict(chassis): + self.__parser_chassis_fail("dictionary is expected: key={}".format(self.CHASSIS_KEY)) + + if not chassis: + self.__parser_chassis_fail("dictionary is empty: key={}".format(self.CHASSIS_KEY)) + + if len(chassis) != 1: + self.__parser_chassis_fail("unexpected number of records: key={}".format(self.CHASSIS_KEY)) + + for key, value in chassis.items(): + if not self.__is_dict(value): + self.__parser_chassis_fail("dictionary is expected: key={}".format(key)) + + if not value: + self.__parser_chassis_fail("dictionary is empty: key={}".format(key)) + + if self.COMPONENT_KEY not in value: + self.__parser_chassis_fail("\"{}\" key hasn't been found".format(self.COMPONENT_KEY)) + + if len(value) != 1: + self.__parser_chassis_fail("unexpected number of records: key={}".format(key)) + + self.__chassis_component_map[key] = OrderedDict() + self.__parse_component_section(key, value[self.COMPONENT_KEY]) + + def get_components_list(self): + self.__component_list = [] + for key, value in self.__chassis_component_map[self.__bf_model].items(): + self.__component_list.append(key) + + return self.__component_list + + def get_chassis_component_map(self): + return self.__chassis_component_map + + def __parse_platform_components(self, platform_components_path): + with open(platform_components_path) as platform_components: + data = json.load(platform_components) + kkey, val = list(data[self.CHASSIS_KEY].items())[0] + self.__bf_model = kkey + + if not self.__is_dict(data): + self.__parser_platform_fail("dictionary is expected: key=root") + + if not data: + self.__parser_platform_fail("dictionary is empty: key=root") + + if self.CHASSIS_KEY not in data: + self.__parser_platform_fail("\"{}\" key hasn't been found".format(self.CHASSIS_KEY)) + + if len(data) != 1: + self.__parser_platform_fail("unexpected number of records: key=root") + + self.__parse_chassis_section(data[self.CHASSIS_KEY]) + + chassis_component_map = property(fget=get_chassis_component_map) + +class Components(ComponentBase): + """BFN Montara Platform-specific Component class""" + bf_platform = device_info.get_path_to_platform_dir() + bf_platform_json = "{}/platform_components.json".format(bf_platform.strip()) + bpcp = BFPlatformComponentsParser(bf_platform_json) + + def __init__(self, component_index=0): + try: + self.index = component_index + self.name = "N/A" + self.version = "N/A" + self.description = "N/A" + self.name = self.bpcp.get_components_list()[self.index] + except IndexError as e: + print("Error: No components found in plaform_components.json") + + if (self.name == "BMC"): + self.version = get_bmc_version() + self.description = "Chassis BMC" + elif (self.name == "BIOS"): + self.version = get_bios_version() + self.description = "Chassis BIOS" + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + if not self.name: + return "N/A" + return self.name + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return self.description + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + Returns: + A string containing the firmware version of the component + """ + return self.version + + def install_firmware(self, image_path): + """ + Installs firmware to the component + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install was successful, False if not + """ + return False + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if component is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the component + Returns: + string: Model/part number of component + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + A boolean value, True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_available_firmware_version(self, image_path): + return 'None' + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + return 'None' + + def update_firmware(self, image_path): + """ + Updates firmware of the component + + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + + Args: + image_path: A string, path to firmware image + + Raises: + RuntimeError: update failed + """ + return False + + def auto_update_firmware(self, image_path, boot_action): + """ + Default handling of attempted automatic update for a component + Will skip the installation if the boot_action is 'warm' or 'fast' and will call update_firmware() + if boot_action is fast. + """ + return 1 diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py index 00e6e54fb33f..2335c02863d9 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py @@ -1,11 +1,7 @@ try: import os import sys - import errno import datetime - import logging - import logging.config - import yaml import re sys.path.append(os.path.dirname(__file__)) @@ -17,6 +13,7 @@ from sonic_platform_base.sonic_eeprom import eeprom_base from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo + from platform_utils import file_create from platform_thrift_client import thrift_try except ImportError as e: @@ -24,38 +21,29 @@ _platform_eeprom_map = { - "prod_name" : ("Product Name", "0x21", 12), - "odm_pcba_part_num" : ("Part Number", "0x22", 13), - "prod_ser_num" : ("Serial Number", "0x23", 12), - "ext_mac_addr" : ("Extended MAC Address Base", "0x24", 12), - "sys_mfg_date" : ("System Manufacturing Date", "0x25", 4), - "prod_ver" : ("Product Version", "0x26", 1), - "ext_mac_addr_size" : ("Extende MAC Address Size", "0x2A", 2), - "sys_mfger" : ("Manufacturer", "0x2B", 8) + "prod_name" : ("Product Name", "0x21", 12), + "odm_pcba_part_num" : ("Part Number", "0x22", 13), + "prod_ser_num" : ("Serial Number", "0x23", 12), + "ext_mac_addr" : ("Extended MAC Address Base", "0x24", 12), + "sys_mfg_date" : ("System Manufacturing Date", "0x25", 4), + "prod_ver" : ("Product Version", "0x26", 1), + "ext_mac_addr_size" : ("Extende MAC Address Size", "0x2A", 2), + "sys_mfger" : ("Manufacturer", "0x2B", 8) } -_product_dict = { "Montara" : "Wedge100BF-32X-O-AC-F-BF", - "Lower MAV" : "Wedge100BF-65X-O-AC-F-BF", - "Upper MAV" : "Wedge100BF-65X-O-AC-F-BF" - } +_product_dict = { + "Montara" : "Wedge100BF-32X-O-AC-F-BF", + "Lower MAV" : "Wedge100BF-65X-O-AC-F-BF", + "Upper MAV" : "Wedge100BF-65X-O-AC-F-BF" +} _EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom" _EEPROM_STATUS = "/var/run/platform/eeprom/status" class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): def __init__(self): - with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f: - config_dict = yaml.load(f, yaml.SafeLoader) - logging.config.dictConfig(config_dict) - - if not os.path.exists(os.path.dirname(_EEPROM_SYMLINK)): - try: - os.makedirs(os.path.dirname(_EEPROM_SYMLINK)) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - open(_EEPROM_SYMLINK, 'a').close() + file_create(_EEPROM_SYMLINK, '646') + file_create(_EEPROM_STATUS, '646') with open(_EEPROM_STATUS, 'w') as f: f.write("initializing..") @@ -148,3 +136,7 @@ def part_number_str(self): def modelstr(self): return self.__tlv_get(self._TLV_CODE_PRODUCT_NAME) + + def revision_str(self): + return self.__tlv_get(self._TLV_CODE_LABEL_REVISION) + diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan.py new file mode 100644 index 000000000000..c13382fddb55 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan.py @@ -0,0 +1,105 @@ +try: + from sonic_platform.platform_thrift_client import thrift_try + from sonic_platform_base.fan_base import FanBase + from sonic_py_common import device_info +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +def _fan_info_get(fan_num, cb, default=None): + def get_data(client): + return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) + fan_info = thrift_try(get_data) + if fan_num == fan_info.fan_num: + return cb(fan_info) + if default is None: + raise LookupError + return default + +# Fan -> FanBase -> DeviceBase +class Fan(FanBase): + def __init__(self, index, fantrayindex): + self.__index = index + self.__fantrayindex = fantrayindex + + # FanBase interface methods: + # returns speed in percents + def get_speed(self): + def cb(info): return info.percent + return _fan_info_get(self.__index, cb, 0) + + def set_speed(self, percent): + # Fan tray speed controlled by BMC + return False + + # DeviceBase interface methods: + def get_name(self): + return "counter-rotating-fan-{}".format((self.__fantrayindex - 1) * self.__index + self.__index) + + def get_presence(self): + return _fan_info_get(self.__index, lambda _: True, False) + + def get_position_in_parent(self): + return self.__index + + def is_replaceable(self): + return False + + def get_status(self): + return (self.get_presence() and self.get_presence() > 0) + + def get_model(self): + """ + Retrieves the part number of the fan drawer + Returns: + string: Part number of fan drawer + """ + return 'N/A' + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + return 'N/A' + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed() + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + if device_info.get_platform() in ["x86_64-accton_as9516_32d-r0", "x86_64-accton_as9516bf_32d-r0"]: + return 6 + return 3 + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + # Fan tray status LED controlled by BMC + return False diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py index b30ea24e0e41..269d3d43b0bf 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py @@ -1,71 +1,20 @@ try: - from sonic_platform.platform_thrift_client import thrift_try from sonic_platform_base.fan_drawer_base import FanDrawerBase - from sonic_platform_base.fan_base import FanBase + from sonic_py_common import device_info + from sonic_platform.fan import Fan except ImportError as e: raise ImportError (str(e) + "- required module not found") -_MAX_FAN = 10 - -def _fan_info_get(fan_num, cb, default=None): - def get_data(client): - return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) - fan_info = thrift_try(get_data) - if fan_num == fan_info.fan_num: - return cb(fan_info) - if default is None: - raise LookupError - return default - -def _fan_info_get_all(): - for fan_num in range(1, _MAX_FAN + 1): - def get_data(client, fan_num=fan_num): - return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) - fan_info = thrift_try(get_data) - if fan_info.fan_num == fan_num: - yield fan_info - -# Fan -> FanBase -> DeviceBase -class Fan(FanBase): - def __init__(self, num): - self.__num = num - - # FanBase interface methods: - # returns speed in percents - def get_speed(self): - def cb(info): return info.percent - return _fan_info_get(self.__num, cb, 0) - - def set_speed(self, percent): - def set_fan_speed(client): - return client.pltfm_mgr.pltfm_mgr_fan_speed_set(self.__num, percent) - return thrift_try(set_fan_speed) - - # DeviceBase interface methods: - def get_name(self): - return f"counter-rotating-fan-{self.__num}" - - def get_presence(self): - return _fan_info_get(self.__num, lambda _: True, False) - - def get_position_in_parent(self): - return self.__num - - def is_replaceable(self): - return True - - def get_status(self): - return True - # FanDrawer -> FanDrawerBase -> DeviceBase class FanDrawer(FanDrawerBase): - def __init__(self): + def __init__(self, fantray_index, max_fan): # For now we return only present fans - self._fan_list = [Fan(i.fan_num) for i in _fan_info_get_all()] + self.fantrayindex = fantray_index + self._fan_list = [Fan(i, self.fantrayindex) for i in range(1, max_fan + 1)] # DeviceBase interface methods: def get_name(self): - return 'fantray' + return f"fantray-{self.fantrayindex}" def get_presence(self): return True @@ -73,5 +22,78 @@ def get_presence(self): def get_status(self): return True + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.fantrayindex + + def is_replaceable(self): + """ + Indicate whether this fan drawer is replaceable. + Returns: + bool: True if it is replaceable, False if not + """ + return False + + def get_model(self): + """ + Retrieves the part number of the fan drawer + Returns: + string: Part number of fan drawer + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the fan drawer + Returns: + string: Serial number of the fan drawer + """ + return 'N/A' + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if set success, False if fail. + """ + # Fan tray status LED controlled by BMC + return False + + def get_status_led(self): + """ + Gets the state of the fan drawer LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return "N/A" + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 36.0 + def fan_drawer_list_get(): - return [FanDrawer()] + platform = device_info.get_platform() + if platform in ["x86_64-accton_as9516_32d-r0", "x86_64-accton_as9516bf_32d-r0"]: + max_fantray = 1 + max_fan = 6 + elif platform == "x86_64-accton_wedge100bf_65x-r0": + max_fantray = 2 + max_fan = 5 + else: + max_fantray = 1 + max_fan = 5 + + return [FanDrawer(i, max_fan) for i in range(1, max_fantray + 1)] diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_thrift_client.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_thrift_client.py index 96c0e09ba1c0..dff16577de74 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_thrift_client.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_thrift_client.py @@ -25,9 +25,9 @@ def open(self): self.transport = TTransport.TBufferedTransport(self.transport) bprotocol = TBinaryProtocol.TBinaryProtocol(self.transport) - pltfm_mgr_client_module = importlib.import_module(".".join(["pltfm_mgr_rpc", "pltfm_mgr_rpc"])) + self.pltfm_mgr_module = importlib.import_module(".".join(["pltfm_mgr_rpc", "pltfm_mgr_rpc"])) pltfm_mgr_protocol = TMultiplexedProtocol.TMultiplexedProtocol(bprotocol, "pltfm_mgr_rpc") - self.pltfm_mgr = pltfm_mgr_client_module.Client(pltfm_mgr_protocol) + self.pltfm_mgr = self.pltfm_mgr_module.Client(pltfm_mgr_protocol) self.transport.open() return self @@ -38,6 +38,13 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, tb): self.close() +def pltfm_mgr_ready(): + try: + with ThriftClient(): + return True + except Exception: + return False + def thrift_try(func, attempts=35): for attempt in range(attempts): try: @@ -47,3 +54,12 @@ def thrift_try(func, attempts=35): if attempt + 1 == attempts: raise e time.sleep(1) + +def pltfm_mgr_try(func, default=None, thrift_attempts=35): + def pm_cb_run(client): + try: + return (None, func(client.pltfm_mgr)) + except client.pltfm_mgr_module.InvalidPltfmMgrOperation as ouch: + return (ouch.code, default) + + return thrift_try(pm_cb_run) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py new file mode 100644 index 000000000000..81e78ee01041 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +try: + import os + import subprocess + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def file_create(path, mode=None): + def run_cmd(cmd): + if os.geteuid() != 0: + cmd.insert(0, 'sudo') + subprocess.check_output(cmd) + + file_path = os.path.dirname(path) + if not os.path.exists(file_path): + run_cmd(['mkdir', '-p', file_path]) + if not os.path.isfile(path): + run_cmd(['touch', path]) + if (mode is not None): + run_cmd(['chmod', mode, path]) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py index b256b6285fc3..0fa03d58b31a 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.10.0) +# Autogenerated by Thrift Compiler (0.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -8,11 +8,14 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys import logging from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport +all_structs = [] class Iface(object): @@ -20,6 +23,7 @@ def pltfm_mgr_dummy(self, device): """ Parameters: - device + """ pass @@ -33,6 +37,7 @@ def pltfm_mgr_pwr_supply_present_get(self, ps_num): """ Parameters: - ps_num + """ pass @@ -40,6 +45,7 @@ def pltfm_mgr_pwr_supply_info_get(self, ps_num): """ Parameters: - ps_num + """ pass @@ -47,6 +53,7 @@ def pltfm_mgr_pwr_rail_info_get(self, ps_num): """ Parameters: - ps_num + """ pass @@ -55,6 +62,7 @@ def pltfm_mgr_fan_speed_set(self, fan_num, percent): Parameters: - fan_num - percent + """ pass @@ -62,6 +70,27 @@ def pltfm_mgr_fan_info_get(self, fan_num): """ Parameters: - fan_num + + """ + pass + + def pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + """ + Parameters: + - port_num + - page + - offset + - length + + """ + pass + + def pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + """ + Parameters: + - port_num + - page + """ pass @@ -69,6 +98,15 @@ def pltfm_mgr_qsfp_presence_get(self, port_num): """ Parameters: - port_num + + """ + pass + + def pltfm_mgr_qsfp_detect_transceiver(self, port_num): + """ + Parameters: + - port_num + """ pass @@ -76,6 +114,7 @@ def pltfm_mgr_qsfp_info_get(self, port_num): """ Parameters: - port_num + """ pass @@ -87,6 +126,138 @@ def pltfm_mgr_qsfp_reset(self, port_num, reset): Parameters: - port_num - reset + + """ + pass + + def pltfm_mgr_qsfp_reset_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_tx_disable(self, port_num, channel_mask, disable): + """ + Parameters: + - port_num + - channel_mask + - disable + + """ + pass + + def pltfm_mgr_qsfp_chan_count_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_rx_pwr_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_bias_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_pwr_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_rx_los_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_los_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_chan_tx_fault_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_temperature_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_voltage_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_thresholds_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_tx_is_disabled(self, port_num, channel): + """ + Parameters: + - port_num + - channel + """ pass @@ -94,6 +265,25 @@ def pltfm_mgr_qsfp_lpmode_get(self, port_num): """ Parameters: - port_num + + """ + pass + + def pltfm_mgr_qsfp_pwr_override_get(self, port_num): + """ + Parameters: + - port_num + + """ + pass + + def pltfm_mgr_qsfp_pwr_override_set(self, port_num, power_override, power_set): + """ + Parameters: + - port_num + - power_override + - power_set + """ pass @@ -102,6 +292,7 @@ def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): Parameters: - port_num - lpmode + """ pass @@ -109,9 +300,13 @@ def pltfm_mgr_sensor_info_get(self, options): """ Parameters: - options + """ pass + def pltfm_mgr_chss_mgmt_bmc_ver_get(self): + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -124,6 +319,7 @@ def pltfm_mgr_dummy(self, device): """ Parameters: - device + """ self.send_pltfm_mgr_dummy(device) return self.recv_pltfm_mgr_dummy() @@ -211,6 +407,7 @@ def pltfm_mgr_pwr_supply_present_get(self, ps_num): """ Parameters: - ps_num + """ self.send_pltfm_mgr_pwr_supply_present_get(ps_num) return self.recv_pltfm_mgr_pwr_supply_present_get() @@ -244,6 +441,7 @@ def pltfm_mgr_pwr_supply_info_get(self, ps_num): """ Parameters: - ps_num + """ self.send_pltfm_mgr_pwr_supply_info_get(ps_num) return self.recv_pltfm_mgr_pwr_supply_info_get() @@ -277,6 +475,7 @@ def pltfm_mgr_pwr_rail_info_get(self, ps_num): """ Parameters: - ps_num + """ self.send_pltfm_mgr_pwr_rail_info_get(ps_num) return self.recv_pltfm_mgr_pwr_rail_info_get() @@ -311,6 +510,7 @@ def pltfm_mgr_fan_speed_set(self, fan_num, percent): Parameters: - fan_num - percent + """ self.send_pltfm_mgr_fan_speed_set(fan_num, percent) return self.recv_pltfm_mgr_fan_speed_set() @@ -345,6 +545,7 @@ def pltfm_mgr_fan_info_get(self, fan_num): """ Parameters: - fan_num + """ self.send_pltfm_mgr_fan_info_get(fan_num) return self.recv_pltfm_mgr_fan_info_get() @@ -374,10 +575,87 @@ def recv_pltfm_mgr_fan_info_get(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_fan_info_get failed: unknown result") + def pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + """ + Parameters: + - port_num + - page + - offset + - length + + """ + self.send_pltfm_mgr_qsfp_cached_num_bytes_get(port_num, page, offset, length) + return self.recv_pltfm_mgr_qsfp_cached_num_bytes_get() + + def send_pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_cached_num_bytes_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_cached_num_bytes_get_args() + args.port_num = port_num + args.page = page + args.offset = offset + args.length = length + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_cached_num_bytes_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_cached_num_bytes_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_cached_num_bytes_get failed: unknown result") + + def pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + """ + Parameters: + - port_num + - page + + """ + self.send_pltfm_mgr_qsfp_cached_page_get(port_num, page) + return self.recv_pltfm_mgr_qsfp_cached_page_get() + + def send_pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_cached_page_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_cached_page_get_args() + args.port_num = port_num + args.page = page + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_cached_page_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_cached_page_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_cached_page_get failed: unknown result") + def pltfm_mgr_qsfp_presence_get(self, port_num): """ Parameters: - port_num + """ self.send_pltfm_mgr_qsfp_presence_get(port_num) return self.recv_pltfm_mgr_qsfp_presence_get() @@ -407,10 +685,45 @@ def recv_pltfm_mgr_qsfp_presence_get(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_presence_get failed: unknown result") + def pltfm_mgr_qsfp_detect_transceiver(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_detect_transceiver(port_num) + return self.recv_pltfm_mgr_qsfp_detect_transceiver() + + def send_pltfm_mgr_qsfp_detect_transceiver(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_detect_transceiver', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_detect_transceiver_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_detect_transceiver(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_detect_transceiver_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_detect_transceiver failed: unknown result") + def pltfm_mgr_qsfp_info_get(self, port_num): """ Parameters: - port_num + """ self.send_pltfm_mgr_qsfp_info_get(port_num) return self.recv_pltfm_mgr_qsfp_info_get() @@ -473,6 +786,7 @@ def pltfm_mgr_qsfp_reset(self, port_num, reset): Parameters: - port_num - reset + """ self.send_pltfm_mgr_qsfp_reset(port_num, reset) return self.recv_pltfm_mgr_qsfp_reset() @@ -503,23 +817,24 @@ def recv_pltfm_mgr_qsfp_reset(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_reset failed: unknown result") - def pltfm_mgr_qsfp_lpmode_get(self, port_num): + def pltfm_mgr_qsfp_reset_get(self, port_num): """ Parameters: - port_num + """ - self.send_pltfm_mgr_qsfp_lpmode_get(port_num) - return self.recv_pltfm_mgr_qsfp_lpmode_get() + self.send_pltfm_mgr_qsfp_reset_get(port_num) + return self.recv_pltfm_mgr_qsfp_reset_get() - def send_pltfm_mgr_qsfp_lpmode_get(self, port_num): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_lpmode_get_args() + def send_pltfm_mgr_qsfp_reset_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_reset_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_reset_get_args() args.port_num = port_num args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pltfm_mgr_qsfp_lpmode_get(self): + def recv_pltfm_mgr_qsfp_reset_get(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -527,34 +842,37 @@ def recv_pltfm_mgr_qsfp_lpmode_get(self): x.read(iprot) iprot.readMessageEnd() raise x - result = pltfm_mgr_qsfp_lpmode_get_result() + result = pltfm_mgr_qsfp_reset_get_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.ouch is not None: raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_lpmode_get failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_reset_get failed: unknown result") - def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): + def pltfm_mgr_qsfp_tx_disable(self, port_num, channel_mask, disable): """ Parameters: - port_num - - lpmode + - channel_mask + - disable + """ - self.send_pltfm_mgr_qsfp_lpmode_set(port_num, lpmode) - return self.recv_pltfm_mgr_qsfp_lpmode_set() + self.send_pltfm_mgr_qsfp_tx_disable(port_num, channel_mask, disable) + return self.recv_pltfm_mgr_qsfp_tx_disable() - def send_pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): - self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_set', TMessageType.CALL, self._seqid) - args = pltfm_mgr_qsfp_lpmode_set_args() + def send_pltfm_mgr_qsfp_tx_disable(self, port_num, channel_mask, disable): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_tx_disable', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_tx_disable_args() args.port_num = port_num - args.lpmode = lpmode + args.channel_mask = channel_mask + args.disable = disable args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pltfm_mgr_qsfp_lpmode_set(self): + def recv_pltfm_mgr_qsfp_tx_disable(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -562,32 +880,33 @@ def recv_pltfm_mgr_qsfp_lpmode_set(self): x.read(iprot) iprot.readMessageEnd() raise x - result = pltfm_mgr_qsfp_lpmode_set_result() + result = pltfm_mgr_qsfp_tx_disable_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.ouch is not None: raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_lpmode_set failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_tx_disable failed: unknown result") - def pltfm_mgr_sensor_info_get(self, options): + def pltfm_mgr_qsfp_chan_count_get(self, port_num): """ Parameters: - - options + - port_num + """ - self.send_pltfm_mgr_sensor_info_get(options) - return self.recv_pltfm_mgr_sensor_info_get() + self.send_pltfm_mgr_qsfp_chan_count_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_count_get() - def send_pltfm_mgr_sensor_info_get(self, options): - self._oprot.writeMessageBegin('pltfm_mgr_sensor_info_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_sensor_info_get_args() - args.options = options + def send_pltfm_mgr_qsfp_chan_count_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_count_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_count_get_args() + args.port_num = port_num args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pltfm_mgr_sensor_info_get(self): + def recv_pltfm_mgr_qsfp_chan_count_get(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -595,398 +914,4738 @@ def recv_pltfm_mgr_sensor_info_get(self): x.read(iprot) iprot.readMessageEnd() raise x - result = pltfm_mgr_sensor_info_get_result() + result = pltfm_mgr_qsfp_chan_count_get_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.ouch is not None: raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_sensor_info_get failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_count_get failed: unknown result") + def pltfm_mgr_qsfp_chan_rx_pwr_get(self, port_num): + """ + Parameters: + - port_num -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["pltfm_mgr_dummy"] = Processor.process_pltfm_mgr_dummy - self._processMap["pltfm_mgr_sys_tmp_get"] = Processor.process_pltfm_mgr_sys_tmp_get - self._processMap["pltfm_mgr_sys_eeprom_get"] = Processor.process_pltfm_mgr_sys_eeprom_get - self._processMap["pltfm_mgr_pwr_supply_present_get"] = Processor.process_pltfm_mgr_pwr_supply_present_get - self._processMap["pltfm_mgr_pwr_supply_info_get"] = Processor.process_pltfm_mgr_pwr_supply_info_get - self._processMap["pltfm_mgr_pwr_rail_info_get"] = Processor.process_pltfm_mgr_pwr_rail_info_get - self._processMap["pltfm_mgr_fan_speed_set"] = Processor.process_pltfm_mgr_fan_speed_set - self._processMap["pltfm_mgr_fan_info_get"] = Processor.process_pltfm_mgr_fan_info_get - self._processMap["pltfm_mgr_qsfp_presence_get"] = Processor.process_pltfm_mgr_qsfp_presence_get - self._processMap["pltfm_mgr_qsfp_info_get"] = Processor.process_pltfm_mgr_qsfp_info_get - self._processMap["pltfm_mgr_qsfp_get_max_port"] = Processor.process_pltfm_mgr_qsfp_get_max_port - self._processMap["pltfm_mgr_qsfp_reset"] = Processor.process_pltfm_mgr_qsfp_reset - self._processMap["pltfm_mgr_qsfp_lpmode_get"] = Processor.process_pltfm_mgr_qsfp_lpmode_get - self._processMap["pltfm_mgr_qsfp_lpmode_set"] = Processor.process_pltfm_mgr_qsfp_lpmode_set - self._processMap["pltfm_mgr_sensor_info_get"] = Processor.process_pltfm_mgr_sensor_info_get + """ + self.send_pltfm_mgr_qsfp_chan_rx_pwr_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_rx_pwr_get() - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True + def send_pltfm_mgr_qsfp_chan_rx_pwr_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_rx_pwr_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_rx_pwr_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_pltfm_mgr_dummy(self, seqid, iprot, oprot): - args = pltfm_mgr_dummy_args() - args.read(iprot) + def recv_pltfm_mgr_qsfp_chan_rx_pwr_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_rx_pwr_get_result() + result.read(iprot) iprot.readMessageEnd() - result = pltfm_mgr_dummy_result() - try: - result.success = self._handler.pltfm_mgr_dummy(args.device) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_dummy", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_rx_pwr_get failed: unknown result") - def process_pltfm_mgr_sys_tmp_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sys_tmp_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sys_tmp_get_result() - try: - result.success = self._handler.pltfm_mgr_sys_tmp_get() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sys_tmp_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def pltfm_mgr_qsfp_chan_tx_bias_get(self, port_num): + """ + Parameters: + - port_num - def process_pltfm_mgr_sys_eeprom_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sys_eeprom_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sys_eeprom_get_result() - try: - result.success = self._handler.pltfm_mgr_sys_eeprom_get() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sys_eeprom_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ + self.send_pltfm_mgr_qsfp_chan_tx_bias_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_bias_get() - def process_pltfm_mgr_pwr_supply_present_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_supply_present_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_pwr_supply_present_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_supply_present_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_supply_present_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def send_pltfm_mgr_qsfp_chan_tx_bias_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_bias_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_bias_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_pltfm_mgr_pwr_supply_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_supply_info_get_args() - args.read(iprot) + def recv_pltfm_mgr_qsfp_chan_tx_bias_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_bias_get_result() + result.read(iprot) iprot.readMessageEnd() - result = pltfm_mgr_pwr_supply_info_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_supply_info_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_supply_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_bias_get failed: unknown result") - def process_pltfm_mgr_pwr_rail_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_pwr_rail_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_pwr_rail_info_get_result() - try: - result.success = self._handler.pltfm_mgr_pwr_rail_info_get(args.ps_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_pwr_rail_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def pltfm_mgr_qsfp_chan_tx_pwr_get(self, port_num): + """ + Parameters: + - port_num - def process_pltfm_mgr_fan_speed_set(self, seqid, iprot, oprot): - args = pltfm_mgr_fan_speed_set_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_fan_speed_set_result() - try: - result.success = self._handler.pltfm_mgr_fan_speed_set(args.fan_num, args.percent) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_fan_speed_set", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + """ + self.send_pltfm_mgr_qsfp_chan_tx_pwr_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_pwr_get() - def process_pltfm_mgr_fan_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_fan_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_fan_info_get_result() - try: - result.success = self._handler.pltfm_mgr_fan_info_get(args.fan_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_fan_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def send_pltfm_mgr_qsfp_chan_tx_pwr_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_pwr_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_pwr_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() - def process_pltfm_mgr_qsfp_presence_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_presence_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_presence_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_presence_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_presence_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def recv_pltfm_mgr_qsfp_chan_tx_pwr_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_pwr_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_pwr_get failed: unknown result") - def process_pltfm_mgr_qsfp_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_info_get_args() - args.read(iprot) + def pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get() + + def send_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result() + result.read(iprot) iprot.readMessageEnd() - result = pltfm_mgr_qsfp_info_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_info_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get failed: unknown result") - def process_pltfm_mgr_qsfp_get_max_port(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_get_max_port_args() - args.read(iprot) + def pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get() + + def send_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result() + result.read(iprot) iprot.readMessageEnd() - result = pltfm_mgr_qsfp_get_max_port_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_get_max_port() - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_get_max_port", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get failed: unknown result") + + def pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get() + + def send_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get failed: unknown result") + + def pltfm_mgr_qsfp_chan_rx_los_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_rx_los_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_rx_los_get() + + def send_pltfm_mgr_qsfp_chan_rx_los_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_rx_los_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_rx_los_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_rx_los_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_rx_los_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_rx_los_get failed: unknown result") + + def pltfm_mgr_qsfp_chan_tx_los_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_tx_los_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_los_get() + + def send_pltfm_mgr_qsfp_chan_tx_los_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_los_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_los_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_tx_los_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_los_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_los_get failed: unknown result") + + def pltfm_mgr_qsfp_chan_tx_fault_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_tx_fault_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_tx_fault_get() + + def send_pltfm_mgr_qsfp_chan_tx_fault_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_chan_tx_fault_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_chan_tx_fault_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_chan_tx_fault_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_chan_tx_fault_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_chan_tx_fault_get failed: unknown result") + + def pltfm_mgr_qsfp_temperature_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_temperature_get(port_num) + return self.recv_pltfm_mgr_qsfp_temperature_get() + + def send_pltfm_mgr_qsfp_temperature_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_temperature_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_temperature_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_temperature_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_temperature_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_temperature_get failed: unknown result") + + def pltfm_mgr_qsfp_voltage_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_voltage_get(port_num) + return self.recv_pltfm_mgr_qsfp_voltage_get() + + def send_pltfm_mgr_qsfp_voltage_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_voltage_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_voltage_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_voltage_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_voltage_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_voltage_get failed: unknown result") + + def pltfm_mgr_qsfp_thresholds_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_thresholds_get(port_num) + return self.recv_pltfm_mgr_qsfp_thresholds_get() + + def send_pltfm_mgr_qsfp_thresholds_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_thresholds_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_thresholds_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_thresholds_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_thresholds_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_thresholds_get failed: unknown result") + + def pltfm_mgr_qsfp_tx_is_disabled(self, port_num, channel): + """ + Parameters: + - port_num + - channel + + """ + self.send_pltfm_mgr_qsfp_tx_is_disabled(port_num, channel) + return self.recv_pltfm_mgr_qsfp_tx_is_disabled() + + def send_pltfm_mgr_qsfp_tx_is_disabled(self, port_num, channel): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_tx_is_disabled', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_tx_is_disabled_args() + args.port_num = port_num + args.channel = channel + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_tx_is_disabled(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_tx_is_disabled_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_tx_is_disabled failed: unknown result") + + def pltfm_mgr_qsfp_lpmode_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_lpmode_get(port_num) + return self.recv_pltfm_mgr_qsfp_lpmode_get() + + def send_pltfm_mgr_qsfp_lpmode_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_lpmode_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_lpmode_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_lpmode_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_lpmode_get failed: unknown result") + + def pltfm_mgr_qsfp_pwr_override_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_pwr_override_get(port_num) + return self.recv_pltfm_mgr_qsfp_pwr_override_get() + + def send_pltfm_mgr_qsfp_pwr_override_get(self, port_num): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_pwr_override_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_pwr_override_get_args() + args.port_num = port_num + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_pwr_override_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_pwr_override_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_pwr_override_get failed: unknown result") + + def pltfm_mgr_qsfp_pwr_override_set(self, port_num, power_override, power_set): + """ + Parameters: + - port_num + - power_override + - power_set + + """ + self.send_pltfm_mgr_qsfp_pwr_override_set(port_num, power_override, power_set) + return self.recv_pltfm_mgr_qsfp_pwr_override_set() + + def send_pltfm_mgr_qsfp_pwr_override_set(self, port_num, power_override, power_set): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_pwr_override_set', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_pwr_override_set_args() + args.port_num = port_num + args.power_override = power_override + args.power_set = power_set + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_pwr_override_set(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_pwr_override_set_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_pwr_override_set failed: unknown result") + + def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): + """ + Parameters: + - port_num + - lpmode + + """ + self.send_pltfm_mgr_qsfp_lpmode_set(port_num, lpmode) + return self.recv_pltfm_mgr_qsfp_lpmode_set() + + def send_pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_lpmode_set', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_lpmode_set_args() + args.port_num = port_num + args.lpmode = lpmode + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_lpmode_set(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_lpmode_set_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_lpmode_set failed: unknown result") + + def pltfm_mgr_sensor_info_get(self, options): + """ + Parameters: + - options + + """ + self.send_pltfm_mgr_sensor_info_get(options) + return self.recv_pltfm_mgr_sensor_info_get() + + def send_pltfm_mgr_sensor_info_get(self, options): + self._oprot.writeMessageBegin('pltfm_mgr_sensor_info_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_sensor_info_get_args() + args.options = options + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_sensor_info_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_sensor_info_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_sensor_info_get failed: unknown result") + + def pltfm_mgr_chss_mgmt_bmc_ver_get(self): + self.send_pltfm_mgr_chss_mgmt_bmc_ver_get() + return self.recv_pltfm_mgr_chss_mgmt_bmc_ver_get() + + def send_pltfm_mgr_chss_mgmt_bmc_ver_get(self): + self._oprot.writeMessageBegin('pltfm_mgr_chss_mgmt_bmc_ver_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_chss_mgmt_bmc_ver_get_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_chss_mgmt_bmc_ver_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_chss_mgmt_bmc_ver_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_chss_mgmt_bmc_ver_get failed: unknown result") + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["pltfm_mgr_dummy"] = Processor.process_pltfm_mgr_dummy + self._processMap["pltfm_mgr_sys_tmp_get"] = Processor.process_pltfm_mgr_sys_tmp_get + self._processMap["pltfm_mgr_sys_eeprom_get"] = Processor.process_pltfm_mgr_sys_eeprom_get + self._processMap["pltfm_mgr_pwr_supply_present_get"] = Processor.process_pltfm_mgr_pwr_supply_present_get + self._processMap["pltfm_mgr_pwr_supply_info_get"] = Processor.process_pltfm_mgr_pwr_supply_info_get + self._processMap["pltfm_mgr_pwr_rail_info_get"] = Processor.process_pltfm_mgr_pwr_rail_info_get + self._processMap["pltfm_mgr_fan_speed_set"] = Processor.process_pltfm_mgr_fan_speed_set + self._processMap["pltfm_mgr_fan_info_get"] = Processor.process_pltfm_mgr_fan_info_get + self._processMap["pltfm_mgr_qsfp_cached_num_bytes_get"] = Processor.process_pltfm_mgr_qsfp_cached_num_bytes_get + self._processMap["pltfm_mgr_qsfp_cached_page_get"] = Processor.process_pltfm_mgr_qsfp_cached_page_get + self._processMap["pltfm_mgr_qsfp_presence_get"] = Processor.process_pltfm_mgr_qsfp_presence_get + self._processMap["pltfm_mgr_qsfp_detect_transceiver"] = Processor.process_pltfm_mgr_qsfp_detect_transceiver + self._processMap["pltfm_mgr_qsfp_info_get"] = Processor.process_pltfm_mgr_qsfp_info_get + self._processMap["pltfm_mgr_qsfp_get_max_port"] = Processor.process_pltfm_mgr_qsfp_get_max_port + self._processMap["pltfm_mgr_qsfp_reset"] = Processor.process_pltfm_mgr_qsfp_reset + self._processMap["pltfm_mgr_qsfp_reset_get"] = Processor.process_pltfm_mgr_qsfp_reset_get + self._processMap["pltfm_mgr_qsfp_tx_disable"] = Processor.process_pltfm_mgr_qsfp_tx_disable + self._processMap["pltfm_mgr_qsfp_chan_count_get"] = Processor.process_pltfm_mgr_qsfp_chan_count_get + self._processMap["pltfm_mgr_qsfp_chan_rx_pwr_get"] = Processor.process_pltfm_mgr_qsfp_chan_rx_pwr_get + self._processMap["pltfm_mgr_qsfp_chan_tx_bias_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_bias_get + self._processMap["pltfm_mgr_qsfp_chan_tx_pwr_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_pwr_get + self._processMap["pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get"] = Processor.process_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get + self._processMap["pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get + self._processMap["pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get + self._processMap["pltfm_mgr_qsfp_chan_rx_los_get"] = Processor.process_pltfm_mgr_qsfp_chan_rx_los_get + self._processMap["pltfm_mgr_qsfp_chan_tx_los_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_los_get + self._processMap["pltfm_mgr_qsfp_chan_tx_fault_get"] = Processor.process_pltfm_mgr_qsfp_chan_tx_fault_get + self._processMap["pltfm_mgr_qsfp_temperature_get"] = Processor.process_pltfm_mgr_qsfp_temperature_get + self._processMap["pltfm_mgr_qsfp_voltage_get"] = Processor.process_pltfm_mgr_qsfp_voltage_get + self._processMap["pltfm_mgr_qsfp_thresholds_get"] = Processor.process_pltfm_mgr_qsfp_thresholds_get + self._processMap["pltfm_mgr_qsfp_tx_is_disabled"] = Processor.process_pltfm_mgr_qsfp_tx_is_disabled + self._processMap["pltfm_mgr_qsfp_lpmode_get"] = Processor.process_pltfm_mgr_qsfp_lpmode_get + self._processMap["pltfm_mgr_qsfp_pwr_override_get"] = Processor.process_pltfm_mgr_qsfp_pwr_override_get + self._processMap["pltfm_mgr_qsfp_pwr_override_set"] = Processor.process_pltfm_mgr_qsfp_pwr_override_set + self._processMap["pltfm_mgr_qsfp_lpmode_set"] = Processor.process_pltfm_mgr_qsfp_lpmode_set + self._processMap["pltfm_mgr_sensor_info_get"] = Processor.process_pltfm_mgr_sensor_info_get + self._processMap["pltfm_mgr_chss_mgmt_bmc_ver_get"] = Processor.process_pltfm_mgr_chss_mgmt_bmc_ver_get + self._on_message_begin = None + + def on_message_begin(self, func): + self._on_message_begin = func + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if self._on_message_begin: + self._on_message_begin(name, type, seqid) + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_pltfm_mgr_dummy(self, seqid, iprot, oprot): + args = pltfm_mgr_dummy_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_dummy_result() + try: + result.success = self._handler.pltfm_mgr_dummy(args.device) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_dummy", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_sys_tmp_get(self, seqid, iprot, oprot): + args = pltfm_mgr_sys_tmp_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_sys_tmp_get_result() + try: + result.success = self._handler.pltfm_mgr_sys_tmp_get() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_sys_tmp_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_sys_eeprom_get(self, seqid, iprot, oprot): + args = pltfm_mgr_sys_eeprom_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_sys_eeprom_get_result() + try: + result.success = self._handler.pltfm_mgr_sys_eeprom_get() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_sys_eeprom_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_pwr_supply_present_get(self, seqid, iprot, oprot): + args = pltfm_mgr_pwr_supply_present_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_pwr_supply_present_get_result() + try: + result.success = self._handler.pltfm_mgr_pwr_supply_present_get(args.ps_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_pwr_supply_present_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_pwr_supply_info_get(self, seqid, iprot, oprot): + args = pltfm_mgr_pwr_supply_info_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_pwr_supply_info_get_result() + try: + result.success = self._handler.pltfm_mgr_pwr_supply_info_get(args.ps_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_pwr_supply_info_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_pwr_rail_info_get(self, seqid, iprot, oprot): + args = pltfm_mgr_pwr_rail_info_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_pwr_rail_info_get_result() + try: + result.success = self._handler.pltfm_mgr_pwr_rail_info_get(args.ps_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_pwr_rail_info_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_fan_speed_set(self, seqid, iprot, oprot): + args = pltfm_mgr_fan_speed_set_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_fan_speed_set_result() + try: + result.success = self._handler.pltfm_mgr_fan_speed_set(args.fan_num, args.percent) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_fan_speed_set", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_fan_info_get(self, seqid, iprot, oprot): + args = pltfm_mgr_fan_info_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_fan_info_get_result() + try: + result.success = self._handler.pltfm_mgr_fan_info_get(args.fan_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_fan_info_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_cached_num_bytes_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_cached_num_bytes_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_cached_num_bytes_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_cached_num_bytes_get(args.port_num, args.page, args.offset, args.length) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_cached_num_bytes_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_cached_page_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_cached_page_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_cached_page_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_cached_page_get(args.port_num, args.page) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_cached_page_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_presence_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_presence_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_presence_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_presence_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_presence_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_detect_transceiver(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_detect_transceiver_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_detect_transceiver_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_detect_transceiver(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_detect_transceiver", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_info_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_info_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_info_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_info_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_info_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_get_max_port(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_get_max_port_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_get_max_port_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_get_max_port() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_get_max_port", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_reset(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_reset_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_reset_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_reset(args.port_num, args.reset) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_reset", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_reset_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_reset_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_reset_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_reset_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_reset_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_tx_disable(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_tx_disable_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_tx_disable_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_tx_disable(args.port_num, args.channel_mask, args.disable) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_tx_disable", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_count_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_count_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_count_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_count_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_count_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_rx_pwr_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_rx_pwr_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_rx_pwr_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_rx_pwr_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_rx_pwr_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_bias_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_bias_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_bias_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_bias_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_bias_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_pwr_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_pwr_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_pwr_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_pwr_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_pwr_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_rx_los_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_rx_los_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_rx_los_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_rx_los_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_rx_los_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_los_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_los_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_los_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_los_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_los_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_chan_tx_fault_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_chan_tx_fault_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_chan_tx_fault_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_chan_tx_fault_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_chan_tx_fault_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_temperature_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_temperature_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_temperature_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_temperature_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_temperature_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_voltage_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_voltage_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_voltage_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_voltage_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_voltage_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_thresholds_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_thresholds_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_thresholds_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_thresholds_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_thresholds_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_tx_is_disabled(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_tx_is_disabled_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_tx_is_disabled_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_tx_is_disabled(args.port_num, args.channel) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_tx_is_disabled", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_lpmode_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_lpmode_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_lpmode_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_lpmode_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_pwr_override_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_pwr_override_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_pwr_override_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_pwr_override_get(args.port_num) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_pwr_override_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_pwr_override_set(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_pwr_override_set_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_pwr_override_set_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_pwr_override_set(args.port_num, args.power_override, args.power_set) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_pwr_override_set", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_lpmode_set(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_lpmode_set_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_lpmode_set_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_lpmode_set(args.port_num, args.lpmode) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_set", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_sensor_info_get(self, seqid, iprot, oprot): + args = pltfm_mgr_sensor_info_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_sensor_info_get_result() + try: + result.success = self._handler.pltfm_mgr_sensor_info_get(args.options) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_sensor_info_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_chss_mgmt_bmc_ver_get(self, seqid, iprot, oprot): + args = pltfm_mgr_chss_mgmt_bmc_ver_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_chss_mgmt_bmc_ver_get_result() + try: + result.success = self._handler.pltfm_mgr_chss_mgmt_bmc_ver_get() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_chss_mgmt_bmc_ver_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + +# HELPER FUNCTIONS AND STRUCTURES + + +class pltfm_mgr_dummy_args(object): + """ + Attributes: + - device + + """ + + + def __init__(self, device=None,): + self.device = device + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.BYTE: + self.device = iprot.readByte() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_dummy_args') + if self.device is not None: + oprot.writeFieldBegin('device', TType.BYTE, 1) + oprot.writeByte(self.device) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_dummy_args) +pltfm_mgr_dummy_args.thrift_spec = ( + None, # 0 + (1, TType.BYTE, 'device', None, None, ), # 1 +) + + +class pltfm_mgr_dummy_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_dummy_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_dummy_result) +pltfm_mgr_dummy_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 +) + + +class pltfm_mgr_sys_tmp_get_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_sys_tmp_get_args) +pltfm_mgr_sys_tmp_get_args.thrift_spec = ( +) + + +class pltfm_mgr_sys_tmp_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_sys_tmp_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_sys_tmp_get_result) +pltfm_mgr_sys_tmp_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_sys_tmp_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_sys_eeprom_get_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_sys_eeprom_get_args) +pltfm_mgr_sys_eeprom_get_args.thrift_spec = ( +) + + +class pltfm_mgr_sys_eeprom_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_eeprom_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_sys_eeprom_get_result) +pltfm_mgr_sys_eeprom_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_eeprom_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_pwr_supply_present_get_args(object): + """ + Attributes: + - ps_num + + """ + + + def __init__(self, ps_num=None,): + self.ps_num = ps_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I16: + self.ps_num = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_args') + if self.ps_num is not None: + oprot.writeFieldBegin('ps_num', TType.I16, 1) + oprot.writeI16(self.ps_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_supply_present_get_args) +pltfm_mgr_pwr_supply_present_get_args.thrift_spec = ( + None, # 0 + (1, TType.I16, 'ps_num', None, None, ), # 1 +) + + +class pltfm_mgr_pwr_supply_present_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_supply_present_get_result) +pltfm_mgr_pwr_supply_present_get_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_pwr_supply_info_get_args(object): + """ + Attributes: + - ps_num + + """ + + + def __init__(self, ps_num=None,): + self.ps_num = ps_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I16: + self.ps_num = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_args') + if self.ps_num is not None: + oprot.writeFieldBegin('ps_num', TType.I16, 1) + oprot.writeI16(self.ps_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_supply_info_get_args) +pltfm_mgr_pwr_supply_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.I16, 'ps_num', None, None, ), # 1 +) + + +class pltfm_mgr_pwr_supply_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_pwr_supply_info_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_supply_info_get_result) +pltfm_mgr_pwr_supply_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_supply_info_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_pwr_rail_info_get_args(object): + """ + Attributes: + - ps_num + + """ + + + def __init__(self, ps_num=None,): + self.ps_num = ps_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I16: + self.ps_num = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_args') + if self.ps_num is not None: + oprot.writeFieldBegin('ps_num', TType.I16, 1) + oprot.writeI16(self.ps_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_rail_info_get_args) +pltfm_mgr_pwr_rail_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.I16, 'ps_num', None, None, ), # 1 +) + + +class pltfm_mgr_pwr_rail_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_pwr_rail_info_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_rail_info_get_result) +pltfm_mgr_pwr_rail_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_rail_info_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_fan_speed_set_args(object): + """ + Attributes: + - fan_num + - percent + + """ + + + def __init__(self, fan_num=None, percent=None,): + self.fan_num = fan_num + self.percent = percent + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.fan_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.percent = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_fan_speed_set_args') + if self.fan_num is not None: + oprot.writeFieldBegin('fan_num', TType.I32, 1) + oprot.writeI32(self.fan_num) + oprot.writeFieldEnd() + if self.percent is not None: + oprot.writeFieldBegin('percent', TType.I32, 2) + oprot.writeI32(self.percent) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_fan_speed_set_args) +pltfm_mgr_fan_speed_set_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'fan_num', None, None, ), # 1 + (2, TType.I32, 'percent', None, None, ), # 2 +) + + +class pltfm_mgr_fan_speed_set_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_fan_speed_set_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_fan_speed_set_result) +pltfm_mgr_fan_speed_set_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_fan_info_get_args(object): + """ + Attributes: + - fan_num + + """ + + + def __init__(self, fan_num=None,): + self.fan_num = fan_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.fan_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_fan_info_get_args') + if self.fan_num is not None: + oprot.writeFieldBegin('fan_num', TType.I32, 1) + oprot.writeI32(self.fan_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_fan_info_get_args) +pltfm_mgr_fan_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'fan_num', None, None, ), # 1 +) + + +class pltfm_mgr_fan_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_fan_info_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_fan_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_fan_info_get_result) +pltfm_mgr_fan_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_fan_info_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_cached_num_bytes_get_args(object): + """ + Attributes: + - port_num + - page + - offset + - length + + """ + + + def __init__(self, port_num=None, page=None, offset=None, length=None,): + self.port_num = port_num + self.page = page + self.offset = offset + self.length = length + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.page = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.offset = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.length = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_num_bytes_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + if self.page is not None: + oprot.writeFieldBegin('page', TType.I32, 2) + oprot.writeI32(self.page) + oprot.writeFieldEnd() + if self.offset is not None: + oprot.writeFieldBegin('offset', TType.I32, 3) + oprot.writeI32(self.offset) + oprot.writeFieldEnd() + if self.length is not None: + oprot.writeFieldBegin('length', TType.I32, 4) + oprot.writeI32(self.length) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_cached_num_bytes_get_args) +pltfm_mgr_qsfp_cached_num_bytes_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'page', None, None, ), # 2 + (3, TType.I32, 'offset', None, None, ), # 3 + (4, TType.I32, 'length', None, None, ), # 4 +) + + +class pltfm_mgr_qsfp_cached_num_bytes_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_num_bytes_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_cached_num_bytes_get_result) +pltfm_mgr_qsfp_cached_num_bytes_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_cached_page_get_args(object): + """ + Attributes: + - port_num + - page + + """ + + + def __init__(self, port_num=None, page=None,): + self.port_num = port_num + self.page = page + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.page = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_page_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + if self.page is not None: + oprot.writeFieldBegin('page', TType.I32, 2) + oprot.writeI32(self.page) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_cached_page_get_args) +pltfm_mgr_qsfp_cached_page_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'page', None, None, ), # 2 +) + + +class pltfm_mgr_qsfp_cached_page_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_page_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_cached_page_get_result) +pltfm_mgr_qsfp_cached_page_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_presence_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_presence_get_args) +pltfm_mgr_qsfp_presence_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_presence_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_presence_get_result) +pltfm_mgr_qsfp_presence_get_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_detect_transceiver_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_detect_transceiver_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_detect_transceiver_args) +pltfm_mgr_qsfp_detect_transceiver_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_detect_transceiver_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_detect_transceiver_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_detect_transceiver_result) +pltfm_mgr_qsfp_detect_transceiver_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_info_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_info_get_args) +pltfm_mgr_qsfp_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_info_get_result) +pltfm_mgr_qsfp_info_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_get_max_port_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_get_max_port_args) +pltfm_mgr_qsfp_get_max_port_args.thrift_spec = ( +) + + +class pltfm_mgr_qsfp_get_max_port_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_get_max_port_result) +pltfm_mgr_qsfp_get_max_port_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_reset_args(object): + """ + Attributes: + - port_num + - reset + + """ + + + def __init__(self, port_num=None, reset=None,): + self.port_num = port_num + self.reset = reset + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.reset = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_reset_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + if self.reset is not None: + oprot.writeFieldBegin('reset', TType.BOOL, 2) + oprot.writeBool(self.reset) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_reset_args) +pltfm_mgr_qsfp_reset_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.BOOL, 'reset', None, None, ), # 2 +) + + +class pltfm_mgr_qsfp_reset_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_reset_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_reset_result) +pltfm_mgr_qsfp_reset_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_reset_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_reset_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_reset_get_args) +pltfm_mgr_qsfp_reset_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_reset_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_reset_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_reset_get_result) +pltfm_mgr_qsfp_reset_get_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_tx_disable_args(object): + """ + Attributes: + - port_num + - channel_mask + - disable + + """ + + + def __init__(self, port_num=None, channel_mask=None, disable=None,): + self.port_num = port_num + self.channel_mask = channel_mask + self.disable = disable + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.channel_mask = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.disable = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_tx_disable_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + if self.channel_mask is not None: + oprot.writeFieldBegin('channel_mask', TType.I32, 2) + oprot.writeI32(self.channel_mask) + oprot.writeFieldEnd() + if self.disable is not None: + oprot.writeFieldBegin('disable', TType.BOOL, 3) + oprot.writeBool(self.disable) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_tx_disable_args) +pltfm_mgr_qsfp_tx_disable_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'channel_mask', None, None, ), # 2 + (3, TType.BOOL, 'disable', None, None, ), # 3 +) + + +class pltfm_mgr_qsfp_tx_disable_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_tx_disable_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_tx_disable_result) +pltfm_mgr_qsfp_tx_disable_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_count_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_count_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_count_get_args) +pltfm_mgr_qsfp_chan_count_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_count_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_count_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_count_get_result) +pltfm_mgr_qsfp_chan_count_get_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_rx_pwr_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_pwr_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_pwr_get_args) +pltfm_mgr_qsfp_chan_rx_pwr_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_rx_pwr_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in range(_size0): + _elem5 = iprot.readDouble() + self.success.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_pwr_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.DOUBLE, len(self.success)) + for iter6 in self.success: + oprot.writeDouble(iter6) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_pwr_get_result) +pltfm_mgr_qsfp_chan_rx_pwr_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_tx_bias_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_bias_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_bias_get_args) +pltfm_mgr_qsfp_chan_tx_bias_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_tx_bias_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in range(_size7): + _elem12 = iprot.readDouble() + self.success.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_bias_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.DOUBLE, len(self.success)) + for iter13 in self.success: + oprot.writeDouble(iter13) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_bias_get_result) +pltfm_mgr_qsfp_chan_tx_bias_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_tx_pwr_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_pwr_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_pwr_get_args) +pltfm_mgr_qsfp_chan_tx_pwr_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_tx_pwr_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype17, _size14) = iprot.readListBegin() + for _i18 in range(_size14): + _elem19 = iprot.readDouble() + self.success.append(_elem19) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_pwr_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.DOUBLE, len(self.success)) + for iter20 in self.success: + oprot.writeDouble(iter20) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_pwr_get_result) +pltfm_mgr_qsfp_chan_tx_pwr_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.DOUBLE, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args(object): + """ + Attributes: + - port_num + + """ + + + def __init__(self, port_num=None,): + self.port_num = port_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args) +pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) + + +class pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype24, _size21) = iprot.readListBegin() + for _i25 in range(_size21): + _elem26 = pltfm_mgr_qsfp_alarm_flags_t() + _elem26.read(iprot) + self.success.append(_elem26) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() - def process_pltfm_mgr_qsfp_reset(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_reset_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_reset_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_reset(args.port_num, args.reset) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_reset", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter27 in self.success: + iter27.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() - def process_pltfm_mgr_qsfp_lpmode_get(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_lpmode_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_lpmode_get_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_lpmode_get(args.port_num) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def validate(self): + return - def process_pltfm_mgr_qsfp_lpmode_set(self, seqid, iprot, oprot): - args = pltfm_mgr_qsfp_lpmode_set_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_qsfp_lpmode_set_result() - try: - result.success = self._handler.pltfm_mgr_qsfp_lpmode_set(args.port_num, args.lpmode) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_qsfp_lpmode_set", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - def process_pltfm_mgr_sensor_info_get(self, seqid, iprot, oprot): - args = pltfm_mgr_sensor_info_get_args() - args.read(iprot) - iprot.readMessageEnd() - result = pltfm_mgr_sensor_info_get_result() - try: - result.success = self._handler.pltfm_mgr_sensor_info_get(args.options) - msg_type = TMessageType.REPLY - except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): - raise - except InvalidPltfmMgrOperation as ouch: - msg_type = TMessageType.REPLY - result.ouch = ouch - except Exception as ex: - msg_type = TMessageType.EXCEPTION - logging.exception(ex) - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_sensor_info_get", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ -# HELPER FUNCTIONS AND STRUCTURES + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result) +pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [pltfm_mgr_qsfp_alarm_flags_t, None], False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_dummy_args(object): +class pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args(object): """ Attributes: - - device + - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'device', None, None, ), # 1 - ) - def __init__(self, device=None,): - self.device = device + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -994,8 +5653,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.BYTE: - self.device = iprot.readByte() + if ftype == TType.I32: + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1005,12 +5664,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_dummy_args') - if self.device is not None: - oprot.writeFieldBegin('device', TType.BYTE, 1) - oprot.writeByte(self.device) + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1028,24 +5687,29 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args) +pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_dummy_result(object): +class pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result(object): """ Attributes: - success + - ouch + """ - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - ) - def __init__(self, success=None,): + def __init__(self, success=None, ouch=None,): self.success = success + self.ouch = ouch def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1053,8 +5717,19 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.LIST: + self.success = [] + (_etype31, _size28) = iprot.readListBegin() + for _i32 in range(_size28): + _elem33 = pltfm_mgr_qsfp_alarm_flags_t() + _elem33.read(iprot) + self.success.append(_elem33) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1064,12 +5739,19 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_dummy_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter34 in self.success: + iter34.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1087,22 +5769,38 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result) +pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [pltfm_mgr_qsfp_alarm_flags_t, None], False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_sys_tmp_get_args(object): +class pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args(object): + """ + Attributes: + - port_num + + """ - thrift_spec = ( - ) + + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -1110,9 +5808,13 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1129,19 +5831,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args) +pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_sys_tmp_get_result(object): +class pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_sys_tmp_t, pltfm_mgr_sys_tmp_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1149,7 +5853,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1157,15 +5861,19 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_sys_tmp_t() - self.success.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype38, _size35) = iprot.readListBegin() + for _i39 in range(_size35): + _elem40 = pltfm_mgr_qsfp_alarm_flags_t() + _elem40.read(iprot) + self.success.append(_elem40) + iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1175,12 +5883,15 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sys_tmp_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter41 in self.success: + iter41.write(oprot) + oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1202,22 +5913,38 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result) +pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT, [pltfm_mgr_qsfp_alarm_flags_t, None], False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_sys_eeprom_get_args(object): +class pltfm_mgr_qsfp_chan_rx_los_get_args(object): + """ + Attributes: + - port_num + + """ + - thrift_spec = ( - ) + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -1225,9 +5952,13 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_los_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1244,19 +5975,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_los_get_args) +pltfm_mgr_qsfp_chan_rx_los_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_sys_eeprom_get_result(object): +class pltfm_mgr_qsfp_chan_rx_los_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_eeprom_t, pltfm_mgr_eeprom_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1264,7 +5997,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1272,15 +6005,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_eeprom_t() - self.success.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype45, _size42) = iprot.readListBegin() + for _i46 in range(_size42): + _elem47 = iprot.readBool() + self.success.append(_elem47) + iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1290,12 +6026,15 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sys_eeprom_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_los_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.BOOL, len(self.success)) + for iter48 in self.success: + oprot.writeBool(iter48) + oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1317,25 +6056,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_rx_los_get_result) +pltfm_mgr_qsfp_chan_rx_los_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.BOOL, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_pwr_supply_present_get_args(object): +class pltfm_mgr_qsfp_chan_tx_los_get_args(object): """ Attributes: - - ps_num + - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) - def __init__(self, ps_num=None,): - self.ps_num = ps_num + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1343,8 +6084,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() + if ftype == TType.I32: + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1354,12 +6095,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_los_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1377,19 +6118,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_los_get_args) +pltfm_mgr_qsfp_chan_tx_los_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_pwr_supply_present_get_result(object): +class pltfm_mgr_qsfp_chan_tx_los_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1397,7 +6140,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1405,14 +6148,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() + if ftype == TType.LIST: + self.success = [] + (_etype52, _size49) = iprot.readListBegin() + for _i53 in range(_size49): + _elem54 = iprot.readBool() + self.success.append(_elem54) + iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1422,12 +6169,15 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_present_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_los_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.BOOL, len(self.success)) + for iter55 in self.success: + oprot.writeBool(iter55) + oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1449,25 +6199,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_los_get_result) +pltfm_mgr_qsfp_chan_tx_los_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.BOOL, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_pwr_supply_info_get_args(object): +class pltfm_mgr_qsfp_chan_tx_fault_get_args(object): """ Attributes: - - ps_num + - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) - def __init__(self, ps_num=None,): - self.ps_num = ps_num + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1475,8 +6227,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() + if ftype == TType.I32: + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1486,12 +6238,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_fault_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1509,19 +6261,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_fault_get_args) +pltfm_mgr_qsfp_chan_tx_fault_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_pwr_supply_info_get_result(object): +class pltfm_mgr_qsfp_chan_tx_fault_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_pwr_supply_info_t, pltfm_mgr_pwr_supply_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1529,7 +6283,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1537,15 +6291,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_supply_info_t() - self.success.read(iprot) + if ftype == TType.LIST: + self.success = [] + (_etype59, _size56) = iprot.readListBegin() + for _i60 in range(_size56): + _elem61 = iprot.readBool() + self.success.append(_elem61) + iprot.readListEnd() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1555,12 +6312,15 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_fault_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.BOOL, len(self.success)) + for iter62 in self.success: + oprot.writeBool(iter62) + oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1582,25 +6342,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_chan_tx_fault_get_result) +pltfm_mgr_qsfp_chan_tx_fault_get_result.thrift_spec = ( + (0, TType.LIST, 'success', (TType.BOOL, None, False), None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_pwr_rail_info_get_args(object): +class pltfm_mgr_qsfp_temperature_get_args(object): """ Attributes: - - ps_num - """ + - port_num - thrift_spec = ( - None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 - ) + """ - def __init__(self, ps_num=None,): - self.ps_num = ps_num + + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1608,8 +6370,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() + if ftype == TType.I32: + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1619,12 +6381,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_temperature_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1642,19 +6404,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_temperature_get_args) +pltfm_mgr_qsfp_temperature_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_pwr_rail_info_get_result(object): +class pltfm_mgr_qsfp_temperature_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_pwr_rail_info_t, pltfm_mgr_pwr_rail_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1662,7 +6426,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1670,15 +6434,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_rail_info_t() - self.success.read(iprot) + if ftype == TType.DOUBLE: + self.success = iprot.readDouble() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1688,12 +6450,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_temperature_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.DOUBLE, 0) + oprot.writeDouble(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1715,28 +6477,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_temperature_get_result) +pltfm_mgr_qsfp_temperature_get_result.thrift_spec = ( + (0, TType.DOUBLE, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_fan_speed_set_args(object): +class pltfm_mgr_qsfp_voltage_get_args(object): """ Attributes: - - fan_num - - percent + - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - (2, TType.I32, 'percent', None, None, ), # 2 - ) - def __init__(self, fan_num=None, percent=None,): - self.fan_num = fan_num - self.percent = percent + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1745,12 +6506,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.I32: - self.fan_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.percent = iprot.readI32() + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1760,16 +6516,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) - oprot.writeFieldEnd() - if self.percent is not None: - oprot.writeFieldBegin('percent', TType.I32, 2) - oprot.writeI32(self.percent) + oprot.writeStructBegin('pltfm_mgr_qsfp_voltage_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1787,19 +6539,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_voltage_get_args) +pltfm_mgr_qsfp_voltage_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_fan_speed_set_result(object): +class pltfm_mgr_qsfp_voltage_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1807,7 +6561,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1815,14 +6569,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.DOUBLE: + self.success = iprot.readDouble() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1832,12 +6585,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_voltage_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.DOUBLE, 0) + oprot.writeDouble(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -1859,25 +6612,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_voltage_get_result) +pltfm_mgr_qsfp_voltage_get_result.thrift_spec = ( + (0, TType.DOUBLE, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_fan_info_get_args(object): +class pltfm_mgr_qsfp_thresholds_get_args(object): """ Attributes: - - fan_num + - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - ) - def __init__(self, fan_num=None,): - self.fan_num = fan_num + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1886,7 +6641,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.I32: - self.fan_num = iprot.readI32() + self.port_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -1896,12 +6651,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_thresholds_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1919,19 +6674,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_thresholds_get_args) +pltfm_mgr_qsfp_thresholds_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_fan_info_get_result(object): +class pltfm_mgr_qsfp_thresholds_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRUCT, 'success', (pltfm_mgr_fan_info_t, pltfm_mgr_fan_info_t.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -1939,7 +6696,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -1948,14 +6705,13 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRUCT: - self.success = pltfm_mgr_fan_info_t() + self.success = pltfm_mgr_qsfp_thresholds_t() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -1965,9 +6721,9 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_thresholds_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) @@ -1992,25 +6748,29 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_thresholds_get_result) +pltfm_mgr_qsfp_thresholds_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_qsfp_thresholds_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_presence_get_args(object): +class pltfm_mgr_qsfp_tx_is_disabled_args(object): """ Attributes: - port_num + - channel + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) - def __init__(self, port_num=None,): + def __init__(self, port_num=None, channel=None,): self.port_num = port_num + self.channel = channel def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2022,6 +6782,11 @@ def read(self, iprot): self.port_num = iprot.readI32() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.channel = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2029,13 +6794,17 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_tx_is_disabled_args') if self.port_num is not None: oprot.writeFieldBegin('port_num', TType.I32, 1) oprot.writeI32(self.port_num) oprot.writeFieldEnd() + if self.channel is not None: + oprot.writeFieldBegin('channel', TType.I32, 2) + oprot.writeI32(self.channel) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2052,19 +6821,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_tx_is_disabled_args) +pltfm_mgr_qsfp_tx_is_disabled_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'channel', None, None, ), # 2 +) -class pltfm_mgr_qsfp_presence_get_result(object): +class pltfm_mgr_qsfp_tx_is_disabled_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2072,7 +6844,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2086,8 +6858,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2097,9 +6868,9 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_presence_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_tx_is_disabled_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) @@ -2124,25 +6895,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_tx_is_disabled_result) +pltfm_mgr_qsfp_tx_is_disabled_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_info_get_args(object): +class pltfm_mgr_qsfp_lpmode_get_args(object): """ Attributes: - port_num + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) def __init__(self, port_num=None,): self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2161,9 +6934,9 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_args') if self.port_num is not None: oprot.writeFieldBegin('port_num', TType.I32, 1) oprot.writeI32(self.port_num) @@ -2184,19 +6957,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_lpmode_get_args) +pltfm_mgr_qsfp_lpmode_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_qsfp_info_get_result(object): +class pltfm_mgr_qsfp_lpmode_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2204,7 +6979,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2212,14 +6987,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2229,12 +7003,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_info_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -2256,22 +7030,38 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_lpmode_get_result) +pltfm_mgr_qsfp_lpmode_get_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_get_max_port_args(object): +class pltfm_mgr_qsfp_pwr_override_get_args(object): + """ + Attributes: + - port_num + + """ + - thrift_spec = ( - ) + def __init__(self, port_num=None,): + self.port_num = port_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break + if fid == 1: + if ftype == TType.I32: + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2279,9 +7069,13 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2298,19 +7092,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_pwr_override_get_args) +pltfm_mgr_qsfp_pwr_override_get_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 +) -class pltfm_mgr_qsfp_get_max_port_result(object): +class pltfm_mgr_qsfp_pwr_override_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2318,7 +7114,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2326,14 +7122,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2343,12 +7138,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_get_max_port_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -2370,28 +7165,31 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_pwr_override_get_result) +pltfm_mgr_qsfp_pwr_override_get_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_reset_args(object): +class pltfm_mgr_qsfp_pwr_override_set_args(object): """ Attributes: - port_num - - reset + - power_override + - power_set + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - (2, TType.BOOL, 'reset', None, None, ), # 2 - ) - def __init__(self, port_num=None, reset=None,): + def __init__(self, port_num=None, power_override=None, power_set=None,): self.port_num = port_num - self.reset = reset + self.power_override = power_override + self.power_set = power_set def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2405,7 +7203,12 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: - self.reset = iprot.readBool() + self.power_override = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.power_set = iprot.readBool() else: iprot.skip(ftype) else: @@ -2415,16 +7218,20 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_reset_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_set_args') if self.port_num is not None: oprot.writeFieldBegin('port_num', TType.I32, 1) oprot.writeI32(self.port_num) oprot.writeFieldEnd() - if self.reset is not None: - oprot.writeFieldBegin('reset', TType.BOOL, 2) - oprot.writeBool(self.reset) + if self.power_override is not None: + oprot.writeFieldBegin('power_override', TType.BOOL, 2) + oprot.writeBool(self.power_override) + oprot.writeFieldEnd() + if self.power_set is not None: + oprot.writeFieldBegin('power_set', TType.BOOL, 3) + oprot.writeBool(self.power_set) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2442,19 +7249,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_pwr_override_set_args) +pltfm_mgr_qsfp_pwr_override_set_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.BOOL, 'power_override', None, None, ), # 2 + (3, TType.BOOL, 'power_set', None, None, ), # 3 +) -class pltfm_mgr_qsfp_reset_result(object): +class pltfm_mgr_qsfp_pwr_override_set_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2462,7 +7273,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2470,14 +7281,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2487,12 +7297,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_reset_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_set_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -2514,25 +7324,29 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_pwr_override_set_result) +pltfm_mgr_qsfp_pwr_override_set_result.thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_lpmode_get_args(object): +class pltfm_mgr_qsfp_lpmode_set_args(object): """ Attributes: - port_num + - lpmode + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - ) - def __init__(self, port_num=None,): + def __init__(self, port_num=None, lpmode=None,): self.port_num = port_num + self.lpmode = lpmode def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2544,6 +7358,11 @@ def read(self, iprot): self.port_num = iprot.readI32() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.lpmode = iprot.readBool() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2551,13 +7370,17 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_args') if self.port_num is not None: oprot.writeFieldBegin('port_num', TType.I32, 1) oprot.writeI32(self.port_num) oprot.writeFieldEnd() + if self.lpmode is not None: + oprot.writeFieldBegin('lpmode', TType.BOOL, 2) + oprot.writeBool(self.lpmode) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2574,19 +7397,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_lpmode_set_args) +pltfm_mgr_qsfp_lpmode_set_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.BOOL, 'lpmode', None, None, ), # 2 +) -class pltfm_mgr_qsfp_lpmode_get_result(object): +class pltfm_mgr_qsfp_lpmode_set_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2594,7 +7420,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2602,14 +7428,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.BOOL: - self.success = iprot.readBool() + if ftype == TType.I32: + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2619,12 +7444,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.BOOL, 0) - oprot.writeBool(self.success) + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -2646,28 +7471,27 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_qsfp_lpmode_set_result) +pltfm_mgr_qsfp_lpmode_set_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_qsfp_lpmode_set_args(object): +class pltfm_mgr_sensor_info_get_args(object): """ Attributes: - - port_num - - lpmode + - options + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port_num', None, None, ), # 1 - (2, TType.BOOL, 'lpmode', None, None, ), # 2 - ) - def __init__(self, port_num=None, lpmode=None,): - self.port_num = port_num - self.lpmode = lpmode + def __init__(self, options=None,): + self.options = options def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2675,13 +7499,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I32: - self.port_num = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.BOOL: - self.lpmode = iprot.readBool() + if ftype == TType.STRING: + self.options = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2691,16 +7510,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_args') - if self.port_num is not None: - oprot.writeFieldBegin('port_num', TType.I32, 1) - oprot.writeI32(self.port_num) - oprot.writeFieldEnd() - if self.lpmode is not None: - oprot.writeFieldBegin('lpmode', TType.BOOL, 2) - oprot.writeBool(self.lpmode) + oprot.writeStructBegin('pltfm_mgr_sensor_info_get_args') + if self.options is not None: + oprot.writeFieldBegin('options', TType.STRING, 1) + oprot.writeString(self.options.encode('utf-8') if sys.version_info[0] == 2 else self.options) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2718,19 +7533,21 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_sensor_info_get_args) +pltfm_mgr_sensor_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'options', 'UTF8', None, ), # 1 +) -class pltfm_mgr_qsfp_lpmode_set_result(object): +class pltfm_mgr_sensor_info_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2738,7 +7555,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2746,14 +7563,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2763,12 +7579,12 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_set_result') + oprot.writeStructBegin('pltfm_mgr_sensor_info_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -2790,36 +7606,25 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_sensor_info_get_result) +pltfm_mgr_sensor_info_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) -class pltfm_mgr_sensor_info_get_args(object): - """ - Attributes: - - options - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'options', 'UTF8', None, ), # 1 - ) +class pltfm_mgr_chss_mgmt_bmc_ver_get_args(object): - def __init__(self, options=None,): - self.options = options def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break - if fid == 1: - if ftype == TType.STRING: - self.options = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2827,13 +7632,9 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sensor_info_get_args') - if self.options is not None: - oprot.writeFieldBegin('options', TType.STRING, 1) - oprot.writeString(self.options.encode('utf-8') if sys.version_info[0] == 2 else self.options) - oprot.writeFieldEnd() + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_ver_get_args') oprot.writeFieldStop() oprot.writeStructEnd() @@ -2850,19 +7651,19 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_chss_mgmt_bmc_ver_get_args) +pltfm_mgr_chss_mgmt_bmc_ver_get_args.thrift_spec = ( +) -class pltfm_mgr_sensor_info_get_result(object): +class pltfm_mgr_chss_mgmt_bmc_ver_get_result(object): """ Attributes: - success - ouch + """ - thrift_spec = ( - (0, TType.STRING, 'success', 'UTF8', None, ), # 0 - (1, TType.STRUCT, 'ouch', (InvalidPltfmMgrOperation, InvalidPltfmMgrOperation.thrift_spec), None, ), # 1 - ) def __init__(self, success=None, ouch=None,): self.success = success @@ -2870,7 +7671,7 @@ def __init__(self, success=None, ouch=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -2879,13 +7680,12 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2895,9 +7695,9 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_sensor_info_get_result') + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_ver_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) @@ -2922,3 +7722,10 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_chss_mgmt_bmc_ver_get_result) +pltfm_mgr_chss_mgmt_bmc_ver_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) +fix_spec(all_structs) +del all_structs diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py index ce03e14f8691..501596941664 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.10.0) +# Autogenerated by Thrift Compiler (0.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -8,9 +8,30 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys from thrift.transport import TTransport +all_structs = [] + + +class qsfp_eeprom_page_t(object): + PAGE0_LOWER = 0 + PAGE0_UPPER = 1 + PAGE3 = 2 + + _VALUES_TO_NAMES = { + 0: "PAGE0_LOWER", + 1: "PAGE0_UPPER", + 2: "PAGE3", + } + + _NAMES_TO_VALUES = { + "PAGE0_LOWER": 0, + "PAGE0_UPPER": 1, + "PAGE3": 2, + } class pltfm_mgr_sys_tmp_t(object): @@ -26,21 +47,9 @@ class pltfm_mgr_sys_tmp_t(object): - tmp8 - tmp9 - tmp10 + """ - thrift_spec = ( - None, # 0 - (1, TType.DOUBLE, 'tmp1', None, None, ), # 1 - (2, TType.DOUBLE, 'tmp2', None, None, ), # 2 - (3, TType.DOUBLE, 'tmp3', None, None, ), # 3 - (4, TType.DOUBLE, 'tmp4', None, None, ), # 4 - (5, TType.DOUBLE, 'tmp5', None, None, ), # 5 - (6, TType.DOUBLE, 'tmp6', None, None, ), # 6 - (7, TType.DOUBLE, 'tmp7', None, None, ), # 7 - (8, TType.DOUBLE, 'tmp8', None, None, ), # 8 - (9, TType.DOUBLE, 'tmp9', None, None, ), # 9 - (10, TType.DOUBLE, 'tmp10', None, None, ), # 10 - ) def __init__(self, tmp1=None, tmp2=None, tmp3=None, tmp4=None, tmp5=None, tmp6=None, tmp7=None, tmp8=None, tmp9=None, tmp10=None,): self.tmp1 = tmp1 @@ -56,7 +65,7 @@ def __init__(self, tmp1=None, tmp2=None, tmp3=None, tmp4=None, tmp5=None, tmp6=N def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -120,7 +129,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_sys_tmp_t') if self.tmp1 is not None: @@ -206,33 +215,9 @@ class pltfm_mgr_eeprom_t(object): - ext_mac_addr_size - location - crc8 + """ - thrift_spec = ( - None, # 0 - (1, TType.I16, 'version', None, None, ), # 1 - (2, TType.STRING, 'prod_name', 'UTF8', None, ), # 2 - (3, TType.STRING, 'prod_part_num', 'UTF8', None, ), # 3 - (4, TType.STRING, 'sys_asm_part_num', 'UTF8', None, ), # 4 - (5, TType.STRING, 'bfn_pcba_part_num', 'UTF8', None, ), # 5 - (6, TType.STRING, 'bfn_pcbb_part_num', 'UTF8', None, ), # 6 - (7, TType.STRING, 'odm_pcba_part_num', 'UTF8', None, ), # 7 - (8, TType.STRING, 'odm_pcba_ser_num', 'UTF8', None, ), # 8 - (9, TType.I16, 'prod_state', None, None, ), # 9 - (10, TType.I16, 'prod_ver', None, None, ), # 10 - (11, TType.I16, 'prod_sub_ver', None, None, ), # 11 - (12, TType.STRING, 'prod_ser_num', 'UTF8', None, ), # 12 - (13, TType.STRING, 'prod_ast_tag', 'UTF8', None, ), # 13 - (14, TType.STRING, 'sys_mfger', 'UTF8', None, ), # 14 - (15, TType.STRING, 'sys_mfg_date', 'UTF8', None, ), # 15 - (16, TType.STRING, 'pcb_mfger', 'UTF8', None, ), # 16 - (17, TType.STRING, 'assembled_at', 'UTF8', None, ), # 17 - (18, TType.STRING, 'loc_mac_addr', 'UTF8', None, ), # 18 - (19, TType.STRING, 'ext_mac_addr', 'UTF8', None, ), # 19 - (20, TType.I32, 'ext_mac_addr_size', None, None, ), # 20 - (21, TType.STRING, 'location', 'UTF8', None, ), # 21 - (22, TType.I16, 'crc8', None, None, ), # 22 - ) def __init__(self, version=None, prod_name=None, prod_part_num=None, sys_asm_part_num=None, bfn_pcba_part_num=None, bfn_pcbb_part_num=None, odm_pcba_part_num=None, odm_pcba_ser_num=None, prod_state=None, prod_ver=None, prod_sub_ver=None, prod_ser_num=None, prod_ast_tag=None, sys_mfger=None, sys_mfg_date=None, pcb_mfger=None, assembled_at=None, loc_mac_addr=None, ext_mac_addr=None, ext_mac_addr_size=None, location=None, crc8=None,): self.version = version @@ -260,7 +245,7 @@ def __init__(self, version=None, prod_name=None, prod_part_num=None, sys_asm_par def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -274,37 +259,37 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.prod_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.prod_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.sys_asm_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_asm_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.bfn_pcba_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.bfn_pcba_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.bfn_pcbb_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.bfn_pcbb_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: - self.odm_pcba_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.odm_pcba_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.odm_pcba_ser_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.odm_pcba_ser_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: @@ -324,42 +309,42 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: - self.prod_ser_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_ser_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: - self.prod_ast_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_ast_tag = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: - self.sys_mfger = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_mfger = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.STRING: - self.sys_mfg_date = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_mfg_date = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 16: if ftype == TType.STRING: - self.pcb_mfger = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.pcb_mfger = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 17: if ftype == TType.STRING: - self.assembled_at = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.assembled_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 18: if ftype == TType.STRING: - self.loc_mac_addr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.loc_mac_addr = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 19: if ftype == TType.STRING: - self.ext_mac_addr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.ext_mac_addr = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 20: @@ -369,7 +354,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 21: if ftype == TType.STRING: - self.location = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.location = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 22: @@ -384,7 +369,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_eeprom_t') if self.version is not None: @@ -506,21 +491,9 @@ class pltfm_mgr_pwr_supply_info_t(object): - model - serial - rev + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'vin', None, None, ), # 1 - (2, TType.I32, 'vout', None, None, ), # 2 - (3, TType.I32, 'iout', None, None, ), # 3 - (4, TType.I32, 'pwr_out', None, None, ), # 4 - (5, TType.I32, 'fspeed', None, None, ), # 5 - (6, TType.BOOL, 'ffault', None, None, ), # 6 - (7, TType.BOOL, 'load_sharing', None, None, ), # 7 - (8, TType.STRING, 'model', 'UTF8', None, ), # 8 - (9, TType.STRING, 'serial', 'UTF8', None, ), # 9 - (10, TType.STRING, 'rev', 'UTF8', None, ), # 10 - ) def __init__(self, vin=None, vout=None, iout=None, pwr_out=None, fspeed=None, ffault=None, load_sharing=None, model=None, serial=None, rev=None,): self.vin = vin @@ -536,7 +509,7 @@ def __init__(self, vin=None, vout=None, iout=None, pwr_out=None, fspeed=None, ff def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -580,17 +553,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.model = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.model = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: - self.serial = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.serial = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: - self.rev = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.rev = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -600,7 +573,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_t') if self.vin is not None: @@ -680,27 +653,9 @@ class pltfm_mgr_pwr_rail_info_t(object): - vrail14 - vrail15 - vrail16 + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'vrail1', None, None, ), # 1 - (2, TType.I32, 'vrail2', None, None, ), # 2 - (3, TType.I32, 'vrail3', None, None, ), # 3 - (4, TType.I32, 'vrail4', None, None, ), # 4 - (5, TType.I32, 'vrail5', None, None, ), # 5 - (6, TType.I32, 'vrail6', None, None, ), # 6 - (7, TType.I32, 'vrail7', None, None, ), # 7 - (8, TType.I32, 'vrail8', None, None, ), # 8 - (9, TType.I32, 'vrail9', None, None, ), # 9 - (10, TType.I32, 'vrail10', None, None, ), # 10 - (11, TType.I32, 'vrail11', None, None, ), # 11 - (12, TType.I32, 'vrail12', None, None, ), # 12 - (13, TType.I32, 'vrail13', None, None, ), # 13 - (14, TType.I32, 'vrail14', None, None, ), # 14 - (15, TType.I32, 'vrail15', None, None, ), # 15 - (16, TType.I32, 'vrail16', None, None, ), # 16 - ) def __init__(self, vrail1=None, vrail2=None, vrail3=None, vrail4=None, vrail5=None, vrail6=None, vrail7=None, vrail8=None, vrail9=None, vrail10=None, vrail11=None, vrail12=None, vrail13=None, vrail14=None, vrail15=None, vrail16=None,): self.vrail1 = vrail1 @@ -722,7 +677,7 @@ def __init__(self, vrail1=None, vrail2=None, vrail3=None, vrail4=None, vrail5=No def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -816,7 +771,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_t') if self.vrail1 is not None: @@ -908,15 +863,9 @@ class pltfm_mgr_fan_info_t(object): - front_rpm - rear_rpm - percent + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - (2, TType.I32, 'front_rpm', None, None, ), # 2 - (3, TType.I32, 'rear_rpm', None, None, ), # 3 - (4, TType.I32, 'percent', None, None, ), # 4 - ) def __init__(self, fan_num=None, front_rpm=None, rear_rpm=None, percent=None,): self.fan_num = fan_num @@ -926,7 +875,7 @@ def __init__(self, fan_num=None, front_rpm=None, rear_rpm=None, percent=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() while True: @@ -960,7 +909,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_fan_info_t') if self.fan_num is not None: @@ -997,42 +946,393 @@ def __ne__(self, other): return not (self == other) -class InvalidPltfmMgrOperation(TException): +class pltfm_mgr_qsfp_alarm_flags_t(object): """ Attributes: - - code + - highalarm + - lowalarm + - highwarning + - lowwarning + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'code', None, None, ), # 1 - ) - def __init__(self, code=None,): - self.code = code + def __init__(self, highalarm=None, lowalarm=None, highwarning=None, lowwarning=None,): + self.highalarm = highalarm + self.lowalarm = lowalarm + self.highwarning = highwarning + self.lowwarning = lowwarning def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.BOOL: + self.highalarm = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.lowalarm = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.highwarning = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.lowwarning = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_alarm_flags_t') + if self.highalarm is not None: + oprot.writeFieldBegin('highalarm', TType.BOOL, 1) + oprot.writeBool(self.highalarm) + oprot.writeFieldEnd() + if self.lowalarm is not None: + oprot.writeFieldBegin('lowalarm', TType.BOOL, 2) + oprot.writeBool(self.lowalarm) + oprot.writeFieldEnd() + if self.highwarning is not None: + oprot.writeFieldBegin('highwarning', TType.BOOL, 3) + oprot.writeBool(self.highwarning) + oprot.writeFieldEnd() + if self.lowwarning is not None: + oprot.writeFieldBegin('lowwarning', TType.BOOL, 4) + oprot.writeBool(self.lowwarning) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class pltfm_mgr_qsfp_threshold_t(object): + """ + Attributes: + - highalarm + - lowalarm + - highwarning + - lowwarning + + """ + + + def __init__(self, highalarm=None, lowalarm=None, highwarning=None, lowwarning=None,): + self.highalarm = highalarm + self.lowalarm = lowalarm + self.highwarning = highwarning + self.lowwarning = lowwarning + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.DOUBLE: + self.highalarm = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.DOUBLE: + self.lowalarm = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.DOUBLE: + self.highwarning = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.DOUBLE: + self.lowwarning = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_threshold_t') + if self.highalarm is not None: + oprot.writeFieldBegin('highalarm', TType.DOUBLE, 1) + oprot.writeDouble(self.highalarm) + oprot.writeFieldEnd() + if self.lowalarm is not None: + oprot.writeFieldBegin('lowalarm', TType.DOUBLE, 2) + oprot.writeDouble(self.lowalarm) + oprot.writeFieldEnd() + if self.highwarning is not None: + oprot.writeFieldBegin('highwarning', TType.DOUBLE, 3) + oprot.writeDouble(self.highwarning) + oprot.writeFieldEnd() + if self.lowwarning is not None: + oprot.writeFieldBegin('lowwarning', TType.DOUBLE, 4) + oprot.writeDouble(self.lowwarning) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class pltfm_mgr_qsfp_thresholds_t(object): + """ + Attributes: + - rx_pwr + - temp + - tx_bias + - tx_pwr + - vcc + - rx_pwr_is_set + - temp_is_set + - tx_bias_is_set + - tx_pwr_is_set + - vcc_is_set + + """ + + + def __init__(self, rx_pwr=None, temp=None, tx_bias=None, tx_pwr=None, vcc=None, rx_pwr_is_set=None, temp_is_set=None, tx_bias_is_set=None, tx_pwr_is_set=None, vcc_is_set=None,): + self.rx_pwr = rx_pwr + self.temp = temp + self.tx_bias = tx_bias + self.tx_pwr = tx_pwr + self.vcc = vcc + self.rx_pwr_is_set = rx_pwr_is_set + self.temp_is_set = temp_is_set + self.tx_bias_is_set = tx_bias_is_set + self.tx_pwr_is_set = tx_pwr_is_set + self.vcc_is_set = vcc_is_set + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.rx_pwr = pltfm_mgr_qsfp_threshold_t() + self.rx_pwr.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.temp = pltfm_mgr_qsfp_threshold_t() + self.temp.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.tx_bias = pltfm_mgr_qsfp_threshold_t() + self.tx_bias.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.tx_pwr = pltfm_mgr_qsfp_threshold_t() + self.tx_pwr.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.vcc = pltfm_mgr_qsfp_threshold_t() + self.vcc.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.BOOL: + self.rx_pwr_is_set = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.BOOL: + self.temp_is_set = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.BOOL: + self.tx_bias_is_set = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.BOOL: + self.tx_pwr_is_set = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.BOOL: + self.vcc_is_set = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_qsfp_thresholds_t') + if self.rx_pwr is not None: + oprot.writeFieldBegin('rx_pwr', TType.STRUCT, 1) + self.rx_pwr.write(oprot) + oprot.writeFieldEnd() + if self.temp is not None: + oprot.writeFieldBegin('temp', TType.STRUCT, 2) + self.temp.write(oprot) + oprot.writeFieldEnd() + if self.tx_bias is not None: + oprot.writeFieldBegin('tx_bias', TType.STRUCT, 3) + self.tx_bias.write(oprot) + oprot.writeFieldEnd() + if self.tx_pwr is not None: + oprot.writeFieldBegin('tx_pwr', TType.STRUCT, 4) + self.tx_pwr.write(oprot) + oprot.writeFieldEnd() + if self.vcc is not None: + oprot.writeFieldBegin('vcc', TType.STRUCT, 5) + self.vcc.write(oprot) + oprot.writeFieldEnd() + if self.rx_pwr_is_set is not None: + oprot.writeFieldBegin('rx_pwr_is_set', TType.BOOL, 6) + oprot.writeBool(self.rx_pwr_is_set) + oprot.writeFieldEnd() + if self.temp_is_set is not None: + oprot.writeFieldBegin('temp_is_set', TType.BOOL, 7) + oprot.writeBool(self.temp_is_set) + oprot.writeFieldEnd() + if self.tx_bias_is_set is not None: + oprot.writeFieldBegin('tx_bias_is_set', TType.BOOL, 8) + oprot.writeBool(self.tx_bias_is_set) + oprot.writeFieldEnd() + if self.tx_pwr_is_set is not None: + oprot.writeFieldBegin('tx_pwr_is_set', TType.BOOL, 9) + oprot.writeBool(self.tx_pwr_is_set) + oprot.writeFieldEnd() + if self.vcc_is_set is not None: + oprot.writeFieldBegin('vcc_is_set', TType.BOOL, 10) + oprot.writeBool(self.vcc_is_set) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class InvalidPltfmMgrOperation(TException): + """ + Attributes: + - code + + """ + + + def __init__(self, code=None,): + super(InvalidPltfmMgrOperation, self).__setattr__('code', code) + + def __setattr__(self, *args): + raise TypeError("can't modify immutable instance") + + def __delattr__(self, *args): + raise TypeError("can't modify immutable instance") + + def __hash__(self): + return hash(self.__class__) ^ hash((self.code, )) + + @classmethod + def read(cls, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) + iprot.readStructBegin() + code = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - self.code = iprot.readI32() + code = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() + return cls( + code=code, + ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('InvalidPltfmMgrOperation') if self.code is not None: @@ -1058,3 +1358,122 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(pltfm_mgr_sys_tmp_t) +pltfm_mgr_sys_tmp_t.thrift_spec = ( + None, # 0 + (1, TType.DOUBLE, 'tmp1', None, None, ), # 1 + (2, TType.DOUBLE, 'tmp2', None, None, ), # 2 + (3, TType.DOUBLE, 'tmp3', None, None, ), # 3 + (4, TType.DOUBLE, 'tmp4', None, None, ), # 4 + (5, TType.DOUBLE, 'tmp5', None, None, ), # 5 + (6, TType.DOUBLE, 'tmp6', None, None, ), # 6 + (7, TType.DOUBLE, 'tmp7', None, None, ), # 7 + (8, TType.DOUBLE, 'tmp8', None, None, ), # 8 + (9, TType.DOUBLE, 'tmp9', None, None, ), # 9 + (10, TType.DOUBLE, 'tmp10', None, None, ), # 10 +) +all_structs.append(pltfm_mgr_eeprom_t) +pltfm_mgr_eeprom_t.thrift_spec = ( + None, # 0 + (1, TType.I16, 'version', None, None, ), # 1 + (2, TType.STRING, 'prod_name', 'UTF8', None, ), # 2 + (3, TType.STRING, 'prod_part_num', 'UTF8', None, ), # 3 + (4, TType.STRING, 'sys_asm_part_num', 'UTF8', None, ), # 4 + (5, TType.STRING, 'bfn_pcba_part_num', 'UTF8', None, ), # 5 + (6, TType.STRING, 'bfn_pcbb_part_num', 'UTF8', None, ), # 6 + (7, TType.STRING, 'odm_pcba_part_num', 'UTF8', None, ), # 7 + (8, TType.STRING, 'odm_pcba_ser_num', 'UTF8', None, ), # 8 + (9, TType.I16, 'prod_state', None, None, ), # 9 + (10, TType.I16, 'prod_ver', None, None, ), # 10 + (11, TType.I16, 'prod_sub_ver', None, None, ), # 11 + (12, TType.STRING, 'prod_ser_num', 'UTF8', None, ), # 12 + (13, TType.STRING, 'prod_ast_tag', 'UTF8', None, ), # 13 + (14, TType.STRING, 'sys_mfger', 'UTF8', None, ), # 14 + (15, TType.STRING, 'sys_mfg_date', 'UTF8', None, ), # 15 + (16, TType.STRING, 'pcb_mfger', 'UTF8', None, ), # 16 + (17, TType.STRING, 'assembled_at', 'UTF8', None, ), # 17 + (18, TType.STRING, 'loc_mac_addr', 'UTF8', None, ), # 18 + (19, TType.STRING, 'ext_mac_addr', 'UTF8', None, ), # 19 + (20, TType.I32, 'ext_mac_addr_size', None, None, ), # 20 + (21, TType.STRING, 'location', 'UTF8', None, ), # 21 + (22, TType.I16, 'crc8', None, None, ), # 22 +) +all_structs.append(pltfm_mgr_pwr_supply_info_t) +pltfm_mgr_pwr_supply_info_t.thrift_spec = ( + None, # 0 + (1, TType.I32, 'vin', None, None, ), # 1 + (2, TType.I32, 'vout', None, None, ), # 2 + (3, TType.I32, 'iout', None, None, ), # 3 + (4, TType.I32, 'pwr_out', None, None, ), # 4 + (5, TType.I32, 'fspeed', None, None, ), # 5 + (6, TType.BOOL, 'ffault', None, None, ), # 6 + (7, TType.BOOL, 'load_sharing', None, None, ), # 7 + (8, TType.STRING, 'model', 'UTF8', None, ), # 8 + (9, TType.STRING, 'serial', 'UTF8', None, ), # 9 + (10, TType.STRING, 'rev', 'UTF8', None, ), # 10 +) +all_structs.append(pltfm_mgr_pwr_rail_info_t) +pltfm_mgr_pwr_rail_info_t.thrift_spec = ( + None, # 0 + (1, TType.I32, 'vrail1', None, None, ), # 1 + (2, TType.I32, 'vrail2', None, None, ), # 2 + (3, TType.I32, 'vrail3', None, None, ), # 3 + (4, TType.I32, 'vrail4', None, None, ), # 4 + (5, TType.I32, 'vrail5', None, None, ), # 5 + (6, TType.I32, 'vrail6', None, None, ), # 6 + (7, TType.I32, 'vrail7', None, None, ), # 7 + (8, TType.I32, 'vrail8', None, None, ), # 8 + (9, TType.I32, 'vrail9', None, None, ), # 9 + (10, TType.I32, 'vrail10', None, None, ), # 10 + (11, TType.I32, 'vrail11', None, None, ), # 11 + (12, TType.I32, 'vrail12', None, None, ), # 12 + (13, TType.I32, 'vrail13', None, None, ), # 13 + (14, TType.I32, 'vrail14', None, None, ), # 14 + (15, TType.I32, 'vrail15', None, None, ), # 15 + (16, TType.I32, 'vrail16', None, None, ), # 16 +) +all_structs.append(pltfm_mgr_fan_info_t) +pltfm_mgr_fan_info_t.thrift_spec = ( + None, # 0 + (1, TType.I32, 'fan_num', None, None, ), # 1 + (2, TType.I32, 'front_rpm', None, None, ), # 2 + (3, TType.I32, 'rear_rpm', None, None, ), # 3 + (4, TType.I32, 'percent', None, None, ), # 4 +) +all_structs.append(pltfm_mgr_qsfp_alarm_flags_t) +pltfm_mgr_qsfp_alarm_flags_t.thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'highalarm', None, None, ), # 1 + (2, TType.BOOL, 'lowalarm', None, None, ), # 2 + (3, TType.BOOL, 'highwarning', None, None, ), # 3 + (4, TType.BOOL, 'lowwarning', None, None, ), # 4 +) +all_structs.append(pltfm_mgr_qsfp_threshold_t) +pltfm_mgr_qsfp_threshold_t.thrift_spec = ( + None, # 0 + (1, TType.DOUBLE, 'highalarm', None, None, ), # 1 + (2, TType.DOUBLE, 'lowalarm', None, None, ), # 2 + (3, TType.DOUBLE, 'highwarning', None, None, ), # 3 + (4, TType.DOUBLE, 'lowwarning', None, None, ), # 4 +) +all_structs.append(pltfm_mgr_qsfp_thresholds_t) +pltfm_mgr_qsfp_thresholds_t.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'rx_pwr', [pltfm_mgr_qsfp_threshold_t, None], None, ), # 1 + (2, TType.STRUCT, 'temp', [pltfm_mgr_qsfp_threshold_t, None], None, ), # 2 + (3, TType.STRUCT, 'tx_bias', [pltfm_mgr_qsfp_threshold_t, None], None, ), # 3 + (4, TType.STRUCT, 'tx_pwr', [pltfm_mgr_qsfp_threshold_t, None], None, ), # 4 + (5, TType.STRUCT, 'vcc', [pltfm_mgr_qsfp_threshold_t, None], None, ), # 5 + (6, TType.BOOL, 'rx_pwr_is_set', None, None, ), # 6 + (7, TType.BOOL, 'temp_is_set', None, None, ), # 7 + (8, TType.BOOL, 'tx_bias_is_set', None, None, ), # 8 + (9, TType.BOOL, 'tx_pwr_is_set', None, None, ), # 9 + (10, TType.BOOL, 'vcc_is_set', None, None, ), # 10 +) +all_structs.append(InvalidPltfmMgrOperation) +InvalidPltfmMgrOperation.thrift_spec = ( + None, # 0 + (1, TType.I32, 'code', None, None, ), # 1 +) +fix_spec(all_structs) +del all_structs diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py index c63bb6528dae..fb9bce50e071 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py @@ -3,6 +3,7 @@ try: import os import sys + import time sys.path.append(os.path.dirname(__file__)) @@ -18,6 +19,10 @@ class Psu(PsuBase): def __init__(self, index): PsuBase.__init__(self) self.__index = index + self.__info = None + self.__ts = 0 + # STUB IMPLEMENTATION + self.color = "" ''' Units of returned info object values: @@ -31,7 +36,16 @@ def __info_get(self): def psu_info_get(client): return client.pltfm_mgr.pltfm_mgr_pwr_supply_info_get(self.__index) - return thrift_try(psu_info_get) + # Update cache once per 2 seconds + if self.__ts + 2 < time.time(): + self.__info = None + try: + self.__info = thrift_try(psu_info_get, attempts=1) + finally: + self.__ts = time.time() + return self.__info + return self.__info + @staticmethod def get_num_psus(): @@ -52,6 +66,8 @@ def get_powergood_status(self): :return: Boolean, True if PSU is operating properly, False if PSU is faulty """ info = self.__info_get() + if info is None: + return False return info.ffault == False and info.vout != 0 def get_voltage(self): @@ -62,7 +78,8 @@ def get_voltage(self): A float number, the output voltage in volts, e.g. 12.1 """ - return float(self.__info_get().vout) + info = self.__info_get() + return float(info.vout) if info else 0 def get_current(self): """ @@ -71,7 +88,8 @@ def get_current(self): Returns: A float number, the electric current in amperes, e.g 15.4 """ - return self.__info_get().iout / 1000. + info = self.__info_get() + return info.iout / 1000 if info else 0 def get_power(self): """ @@ -80,7 +98,8 @@ def get_power(self): Returns: A float number, the power in watts, e.g. 302.6 """ - return self.__info_get().pwr_out / 1000. + info = self.__info_get() + return info.pwr_out / 1000 if info else 0 def get_presence(self): """ @@ -92,19 +111,94 @@ def get_presence(self): def psu_present_get(client): return client.pltfm_mgr.pltfm_mgr_pwr_supply_present_get(self.__index) - status = thrift_try(psu_present_get) - return status + status = False + try: + status = thrift_try(psu_present_get) + finally: + return status + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + + Args: + color: A string representing the color with which to set the + PSU status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + # STUB IMPLEMENTATION + self.color = color + return True + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + # STUB IMPLEMENTATION + return self.color # DeviceBase iface: def get_serial(self): - return self.__info_get().serial + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + info = self.__info_get() + return info.serial if info else "N/A" def get_model(self): - return self.__info_get().model + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + info = self.__info_get() + return info.model if info else "N/A" def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ return True + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + info = self.__info_get() + return info.rev if info else "N/A" + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_powergood_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.__index + def psu_list_get(): psu_list = [] for i in range(1, Psu.get_num_psus() + 1): diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py index 640b1c41948c..f5d800b749c9 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py @@ -2,80 +2,47 @@ try: import os - import sys - import time + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from sonic_platform.platform_thrift_client import thrift_try + from sonic_platform.platform_thrift_client import pltfm_mgr_try +except ImportError as e: + raise ImportError (str(e) + "- required module not found") - import tempfile - from contextlib import contextmanager - from copy import copy +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +QSFP_DD_TYPE = "QSFP_DD" - sys.path.append(os.path.dirname(__file__)) - from .platform_thrift_client import ThriftClient - from .platform_thrift_client import thrift_try +class Sfp(SfpOptoeBase): + """ + BFN Platform-specific SFP class + """ - from sonic_platform_base.sfp_base import SfpBase - from sonic_platform_base.sonic_sfp.sfputilbase import SfpUtilBase -except ImportError as e: - raise ImportError (str(e) + "- required module not found") + SFP_EEPROM_PATH = "/var/run/platform/sfp/" -class SfpUtil(SfpUtilBase): - """Platform-specific SfpUtil class""" - - PORT_START = 1 - PORT_END = 0 - PORTS_IN_BLOCK = 0 - QSFP_PORT_START = 1 - QSFP_PORT_END = 0 - EEPROM_OFFSET = 0 - QSFP_CHECK_INTERVAL = 4 - - @property - def port_start(self): - self.update_port_info() - return self.PORT_START - - @property - def port_end(self): - self.update_port_info() - return self.PORT_END - - @property - def qsfp_ports(self): - self.update_port_info() - return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) - - @property - def port_to_eeprom_mapping(self): - print("dependency on sysfs has been removed") - raise Exception() - - def __init__(self): - self.ready = False - self.phy_port_dict = {'-1': 'system_not_ready'} - self.phy_port_cur_state = {} - self.qsfp_interval = self.QSFP_CHECK_INTERVAL - - SfpUtilBase.__init__(self) - - def update_port_info(self): - def qsfp_max_port_get(client): - return client.pltfm_mgr.pltfm_mgr_qsfp_get_max_port(); - - if self.QSFP_PORT_END == 0: - self.QSFP_PORT_END = thrift_try(qsfp_max_port_get) - self.PORT_END = self.QSFP_PORT_END - self.PORTS_IN_BLOCK = self.QSFP_PORT_END - - def get_presence(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False + def __init__(self, port_num): + SfpOptoeBase.__init__(self) + self.index = port_num + self.port_num = port_num + self.sfp_type = QSFP_TYPE + if not os.path.exists(self.SFP_EEPROM_PATH): + try: + os.makedirs(self.SFP_EEPROM_PATH) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + self.eeprom_path = self.SFP_EEPROM_PATH + "sfp{}-eeprom-cache".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the sfp + """ presence = False def qsfp_presence_get(client): - return client.pltfm_mgr.pltfm_mgr_qsfp_presence_get(port_num) + return client.pltfm_mgr.pltfm_mgr_qsfp_presence_get(self.index) try: presence = thrift_try(qsfp_presence_get) @@ -85,194 +52,156 @@ def qsfp_presence_get(client): return presence - def get_low_power_mode(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + """ def qsfp_lpmode_get(client): - return client.pltfm_mgr.pltfm_mgr_qsfp_lpmode_get(port_num) - - lpmode = thrift_try(qsfp_lpmode_get) + return client.pltfm_mgr.pltfm_mgr_qsfp_lpmode_get(self.index) - return lpmode - - def set_low_power_mode(self, port_num, lpmode): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False + return thrift_try(qsfp_lpmode_get) + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + """ def qsfp_lpmode_set(client): - return client.pltfm_mgr.pltfm_mgr_qsfp_lpmode_set(port_num, lpmode) + return client.pltfm_mgr.pltfm_mgr_qsfp_lpmode_set(self.index, lpmode) status = thrift_try(qsfp_lpmode_set) - return (status == 0) - def reset(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - def qsfp_reset(client): - client.pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, True) - return client.pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, False) - - err = thrift_try(qsfp_reset) - - return not err - - def check_transceiver_change(self): - if not self.ready: - return - - self.phy_port_dict = {} - - try: - client = ThriftClient().open() - except Exception: - return - - # Get presence of each SFP - for port in range(self.port_start, self.port_end + 1): - try: - sfp_resent = client.pltfm_mgr.pltfm_mgr_qsfp_presence_get(port) - except Exception: - sfp_resent = False - sfp_state = '1' if sfp_resent else '0' - - if port in self.phy_port_cur_state: - if self.phy_port_cur_state[port] != sfp_state: - self.phy_port_dict[port] = sfp_state - else: - self.phy_port_dict[port] = sfp_state - - # Update port current state - self.phy_port_cur_state[port] = sfp_state - - client.close() - - def get_transceiver_change_event(self, timeout=0): - forever = False - if timeout == 0: - forever = True - elif timeout > 0: - timeout = timeout / float(1000) # Convert to secs - else: - print("get_transceiver_change_event:Invalid timeout value", timeout) - return False, {} - - while forever or timeout > 0: - if not self.ready: - try: - with ThriftClient(): pass - except Exception: - pass - else: - self.ready = True - self.phy_port_dict = {} - break - elif self.qsfp_interval == 0: - self.qsfp_interval = self.QSFP_CHECK_INTERVAL - - # Process transceiver plug-in/out event - self.check_transceiver_change() - - # Break if tranceiver state has changed - if bool(self.phy_port_dict): - break - - if timeout: - timeout -= 1 - - if self.qsfp_interval: - self.qsfp_interval -= 1 - - time.sleep(1) - - return self.ready, self.phy_port_dict - - @contextmanager - def eeprom_action(self): - u = copy(self) - with tempfile.NamedTemporaryFile() as f: - u.eeprom_path = f.name - yield u - - def _sfp_eeprom_present(self, client_eeprompath, offset): - return client_eeprompath and super(SfpUtil, self)._sfp_eeprom_present(client_eeprompath, offset) - - def _get_port_eeprom_path(self, port_num, devid): + def get_eeprom_path(self): def qsfp_info_get(client): - return client.pltfm_mgr.pltfm_mgr_qsfp_info_get(port_num) + return client.pltfm_mgr.pltfm_mgr_qsfp_info_get(self.index) - if self.get_presence(port_num): + if self.get_presence(): eeprom_hex = thrift_try(qsfp_info_get) eeprom_raw = bytearray.fromhex(eeprom_hex) - with open(self.eeprom_path, 'wb') as eeprom_cache: - eeprom_cache.write(eeprom_raw) + with open(self.eeprom_path, 'wb') as fp: + fp.write(eeprom_raw) return self.eeprom_path return None -class Sfp(SfpBase): - """Platform-specific Sfp class""" - - sfputil = SfpUtil() - - @staticmethod - def port_start(): - return Sfp.sfputil.port_start - - @staticmethod - def port_end(): - return Sfp.sfputil.port_end - - @staticmethod - def qsfp_ports(): - return Sfp.sfputil.qsfp_ports() - - @staticmethod - def get_transceiver_change_event(timeout=0): - return Sfp.sfputil.get_transceiver_change_event() - - def __init__(self, port_num): - self.port_num = port_num - SfpBase.__init__(self) - - def get_presence(self): - with Sfp.sfputil.eeprom_action() as u: - return u.get_presence(self.port_num) - - def get_lpmode(self): - with Sfp.sfputil.eeprom_action() as u: - return u.get_low_power_mode(self.port_num) - - def set_lpmode(self, lpmode): - with Sfp.sfputil.eeprom_action() as u: - return u.set_low_power_mode(self.port_num, lpmode) + def write_eeprom(self, offset, num_bytes, write_buffer): + # Not supported at the moment + return False + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return "sfp{}".format(self.index) + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + """ + def get_qsfp_reset(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_reset_get(self.index) + _, status = pltfm_mgr_try(get_qsfp_reset, False) + return status def reset(self): - return Sfp.sfputil.reset(self.port_num) - - def get_transceiver_info(self): - with Sfp.sfputil.eeprom_action() as u: - return u.get_transceiver_info_dict(self.port_num) - - def get_transceiver_bulk_status(self): - with Sfp.sfputil.eeprom_action() as u: - return u.get_transceiver_dom_info_dict(self.port_num) + """ + Reset SFP and return all user module settings to their default srate. + """ + def qsfp_reset(client): + client.pltfm_mgr.pltfm_mgr_qsfp_reset(self.index, True) + return client.pltfm_mgr.pltfm_mgr_qsfp_reset(self.index, False) - def get_transceiver_threshold_info(self): - with Sfp.sfputil.eeprom_action() as u: - return u.get_transceiver_dom_threshold_info_dict(self.port_num) + err = thrift_try(qsfp_reset) + return not err - def get_change_event(self, timeout=0): - return Sfp.get_transceiver_change_event(timeout) + def get_status(self): + """ + Retrieves the operational status of the device + """ + reset = self.get_reset_status() -def sfp_list_get(): - sfp_list = [] - for index in range(Sfp.port_start(), Sfp.port_end() + 1): - sfp_node = Sfp(index) - sfp_list.append(sfp_node) - return sfp_list + if reset: + status = False + else: + status = True + + return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + return self.SFP_STATUS_OK + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.sfp_type == QSFP_TYPE: + return self.tx_disable_channel(0xF, tx_disable) + return False + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + + Returns: + A boolean, True if successful, False if not + """ + def qsfp_tx_disable_channel(client): + return client.pltfm_mgr.pltfm_mgr_qsfp_tx_disable(self.index, channel, disable) + + if self.sfp_type == QSFP_TYPE: + status = thrift_try(qsfp_tx_disable_channel) + return (status == 0) + return False + + def get_power_override(self): + def get_qsfp_power_override(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_pwr_override_get(self.index) + _, pwr_override = pltfm_mgr_try(get_qsfp_power_override) + return pwr_override + + def set_power_override(self, power_override, power_set): + def set_qsfp_power_override(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_pwr_override_set( + self.index, power_override, power_set + ) + _, status = pltfm_mgr_try(set_qsfp_power_override) + return status diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py index 3a39c10a1e1f..e5034f09f558 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py @@ -1,8 +1,11 @@ try: import subprocess - - from sonic_platform.bfn_extensions.platform_sensors import platform_sensors_get + from collections import namedtuple + import json + from bfn_extensions.platform_sensors import platform_sensors_get from sonic_platform_base.thermal_base import ThermalBase + from sonic_py_common import device_info + import logging except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -18,6 +21,8 @@ temp2_input: 37.000 ... ''' +Threshold = namedtuple('Threshold', ['crit', 'max', 'min', 'alarm']) + def _sensors_chip_parsed(data: str): def kv(line): k, v, *_ = [t.strip(': ') for t in line.split(':') if t] + [''] @@ -68,27 +73,99 @@ def _value_get(d: dict, key_prefix, key_suffix=''): # Thermal -> ThermalBase -> DeviceBase class Thermal(ThermalBase): - def __init__(self, chip, label): + _thresholds = dict() + _max_temperature = 100.0 + _min_temperature = 0.0 + _min_high_threshold_temperature = 35.0 + + def __init__(self, chip, label, index = 0): self.__chip = chip self.__label = label self.__name = f"{chip}:{label}".lower().replace(' ', '-') + self.__collect_temp = [] + self.__index = index + self.__high_threshold = None + self.__low_threshold = None + f = None + try: + path = device_info.get_path_to_platform_dir() + '/' + 'thermal_thresholds.json' + f = open(path) + except FileNotFoundError: + logging.warning('can not open the file') + + if f is not None: + self.__get_thresholds(f) + + def __get_thresholds(self, f): + def_threshold_json = json.load(f) + all_data = def_threshold_json["thermals"] + for i in all_data: + for key, value in i.items(): + self._thresholds[key] = Threshold(*value) + + def check_in_range(self, temperature): + temp_f = float(temperature) + return temp_f > self._min_temperature and temp_f <= self._max_temperature + + def check_high_threshold(self, temperature, attr_suffix): + temp_f = float(temperature) + check_range = True + if attr_suffix == 'max': + if temp_f < self._min_high_threshold_temperature: + if self.__name in self._thresholds: + temp = self._thresholds[self.__name].max + self.set_high_threshold(temp) + check_range = False + return check_range def __get(self, attr_prefix, attr_suffix): sensor_data = _sensors_get().get(self.__chip, {}).get(self.__label, {}) value = _value_get(sensor_data, attr_prefix, attr_suffix) - if value is not None: return value - raise NotImplementedError + if value is not None and self.check_in_range(value) and self.check_high_threshold(value, attr_suffix): + return value + elif self.__name in self._thresholds and attr_prefix == 'temp': + if attr_suffix == 'crit': + return self._thresholds[self.__name].crit + elif attr_suffix == 'max': + if self.__high_threshold is None: + return self._thresholds[self.__name].max + else: + return self.__high_threshold + elif attr_suffix == 'min': + if self.__low_threshold is None: + return self._thresholds[self.__name].min + else: + return self.__low_threshold + elif attr_suffix == 'alarm': + return self._thresholds[self.__name].alarm + else: + return 1.0 + else: + return 0.05 # ThermalBase interface methods: def get_temperature(self) -> float: - return float(self.__get('temp', 'input')) + temp = self.__get('temp', 'input') + self.__collect_temp.append(float(temp)) + self.__collect_temp.sort() + if len(self.__collect_temp) == 3: + del self.__collect_temp[1] + return float(temp) def get_high_threshold(self) -> float: - return float(self.__get('temp', 'max')) + if self.__high_threshold is None: + return float(self.__get('temp', 'max')) + return float(self.__high_threshold) def get_high_critical_threshold(self) -> float: return float(self.__get('temp', 'crit')) + def get_low_critical_threshold(self) -> float: + return float(self.__get('temp', 'alarm')) + + def get_model(self): + return f"{self.__label}".lower() + # DeviceBase interface methods: def get_name(self): return self.__name @@ -99,11 +176,51 @@ def get_presence(self): def get_status(self): return True + def is_replaceable(self): + return False + + def get_low_threshold(self) -> float: + if self.__low_threshold is None: + return float(self.__get('temp', 'min')) + return float(self.__low_threshold) + + def get_serial(self): + return 'N/A' + + def get_minimum_recorded(self) -> float: + temp = self.__collect_temp[0] if len(self.__collect_temp) > 0 else self.get_temperature() + temp = temp if temp <= 100.0 else 100.0 + temp = temp if temp > 0.0 else 0.1 + return float(temp) + + def get_maximum_recorded(self) -> float: + temp = self.__collect_temp[-1] if len(self.__collect_temp) > 0 else self.get_temperature() + temp = temp if temp <= 100.0 else 100.0 + temp = temp if temp > 0.0 else 0.1 + return float(temp) + + def get_position_in_parent(self): + return self.__index + + def set_high_threshold(self, temperature): + if self.check_in_range(temperature): + self.__high_threshold = temperature + return True + return False + + def set_low_threshold(self, temperature): + if self.check_in_range(temperature): + self.__low_threshold = temperature + return True + return False + def thermal_list_get(): l = [] + index = 0 for chip, chip_data in _sensors_get().items(): for sensor, sensor_data in chip_data.items(): # add only temperature sensors if _value_get(sensor_data, "temp") is not None: - l.append(Thermal(chip, sensor)) + l.append(Thermal(chip, sensor, index)) + index += 1 return l diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control index 999ca7c70e3e..9663cc3f644a 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control @@ -2,7 +2,7 @@ Source: sonic-platform-modules-bfn-newport Section: main Priority: extra Maintainer: Support -Build-Depends: debhelper (>= 9.0.0), bzip2 +Build-Depends: debhelper (>= 9.0.0), bzip2, python3 Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn-newport-as9516 diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules index 9edb45b497ab..540bdcafb6fd 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules @@ -13,13 +13,13 @@ WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel MODULE_NAMES := as9516 as9516bf %: - dh $@ + dh $@ --with python3 --buildsystem=pybuild override_dh_auto_build: make -C $(KERNEL_SRC)/build M=$(MODULE_SRC) set -e python3 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR) - set +e + set +e override_dh_auto_install: (for mod in $(MODULE_NAMES); do \ @@ -39,8 +39,8 @@ override_dh_pysupport: override_dh_clean: dh_clean - rm -fr $(WHEEL_BUILD_DIR) - rm -fr *.egg-info + rm -fr $(WHEEL_BUILD_DIR) + rm -fr *.egg-info rm -fr $(BUILD) rm -f $(MODULE_SRC)/*.o $(MODULE_SRC)/*.ko $(MODULE_SRC)/*.mod.c $(MODULE_SRC)/.*.cmd rm -f $(MODULE_SRC)/Module.markers $(MODULE_SRC)/Module.symvers $(MODULE_SRC)/modules.order diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/control b/platform/barefoot/sonic-platform-modules-bfn/debian/control index 5f4dffdc9323..de1a22fdb1b5 100644 --- a/platform/barefoot/sonic-platform-modules-bfn/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/control @@ -2,7 +2,7 @@ Source: sonic-platform-modules-bfn Section: main Priority: extra Maintainer: support -Build-Depends: debhelper (>= 9.0.0), bzip2 +Build-Depends: debhelper (>= 9.0.0), bzip2, python3 Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/rules b/platform/barefoot/sonic-platform-modules-bfn/debian/rules index e52ae2c95074..7af5c9f8de65 100755 --- a/platform/barefoot/sonic-platform-modules-bfn/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/rules @@ -8,7 +8,7 @@ BUILD_DIR := $(shell pwd)/build WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel %: - dh $@ + dh $@ --with python3 --buildsystem=pybuild override_dh_auto_build: set -e @@ -28,8 +28,8 @@ override_dh_usrlocal: override_dh_pysupport: override_dh_clean: - rm -fr $(WHEEL_BUILD_DIR) - rm -fr *.egg-info + rm -fr $(WHEEL_BUILD_DIR) + rm -fr *.egg-info rm -fr $(BUILD) dh_clean diff --git a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control index d4d4f7b49988..bed8117da850 100644 --- a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control +++ b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control @@ -2,7 +2,7 @@ Source: platform-modules-wnc-osw1800 Section: main Priority: extra Maintainer: WNC -Build-Depends: debhelper (>= 8.0.0), bzip2 +Build-Depends: debhelper (>= 8.0.0), bzip2, python3 Standards-Version: 3.9.3 Package: platform-modules-wnc-osw1800 diff --git a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/rules b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/rules index 644ab1ade433..87a468a2900d 100755 --- a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/rules +++ b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/rules @@ -10,7 +10,7 @@ SCRIPT_SRC := $(shell pwd)/scripts SERVICE_SRC := $(shell pwd)/service %: - dh $@ + dh $@ --with python3 override_dh_auto_build: make -C $(KERNEL_SRC)/build M=$(MODULE_SRC)