From f79c0841bb503deb23aa05f4b8c449ef5442f048 Mon Sep 17 00:00:00 2001 From: Volodymyr Boiko Date: Wed, 15 Dec 2021 14:33:43 +0200 Subject: [PATCH] [BFN] Updated SFP platform plugin (#13) Signed-off-by: Volodymyr Boyko --- .../pltfm_mgr_rpc/pltfm_mgr_rpc.py | 1369 +++++++++++++---- .../sonic_platform/pltfm_mgr_rpc/ttypes.py | 107 +- .../sonic_platform/sfp.py | 108 +- 3 files changed, 1254 insertions(+), 330 deletions(-) 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 d88f770c699e..81bd837a8ac3 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 @@ -110,6 +110,14 @@ def pltfm_mgr_qsfp_reset(self, 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: @@ -120,6 +128,14 @@ def pltfm_mgr_qsfp_tx_disable(self, 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: @@ -233,6 +249,24 @@ def pltfm_mgr_qsfp_lpmode_get(self, 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 + def pltfm_mgr_qsfp_lpmode_set(self, port_num, lpmode): """ Parameters: @@ -684,6 +718,40 @@ 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_reset_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_reset_get(port_num) + return self.recv_pltfm_mgr_qsfp_reset_get() + + 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_reset_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_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_reset_get failed: unknown result") + def pltfm_mgr_qsfp_tx_disable(self, port_num, channel_mask, disable): """ Parameters: @@ -722,6 +790,40 @@ def recv_pltfm_mgr_qsfp_tx_disable(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_tx_disable failed: unknown result") + def pltfm_mgr_qsfp_chan_count_get(self, port_num): + """ + Parameters: + - port_num + + """ + self.send_pltfm_mgr_qsfp_chan_count_get(port_num) + return self.recv_pltfm_mgr_qsfp_chan_count_get() + + 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_qsfp_chan_count_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_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_qsfp_chan_count_get failed: unknown result") + def pltfm_mgr_qsfp_chan_rx_pwr_get(self, port_num): """ Parameters: @@ -1200,6 +1302,78 @@ def recv_pltfm_mgr_qsfp_lpmode_get(self): 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: @@ -1288,7 +1462,9 @@ def __init__(self, handler): 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 @@ -1303,6 +1479,8 @@ def __init__(self, handler): 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._on_message_begin = None @@ -1662,6 +1840,32 @@ def process_pltfm_mgr_qsfp_reset(self, seqid, iprot, 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) @@ -1688,6 +1892,32 @@ def process_pltfm_mgr_qsfp_tx_disable(self, seqid, iprot, 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) @@ -2052,6 +2282,58 @@ def process_pltfm_mgr_qsfp_lpmode_get(self, seqid, iprot, 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) @@ -3834,20 +4116,16 @@ def __ne__(self, other): ) -class pltfm_mgr_qsfp_tx_disable_args(object): +class pltfm_mgr_qsfp_reset_get_args(object): """ Attributes: - port_num - - channel_mask - - disable """ - def __init__(self, port_num=None, channel_mask=None, disable=None,): + def __init__(self, port_num=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: @@ -3863,16 +4141,6 @@ def read(self, iprot): 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() @@ -3882,19 +4150,11 @@ 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') + 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() - 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() @@ -3911,16 +4171,14 @@ def __eq__(self, other): 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 = ( +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 - (2, TType.I32, 'channel_mask', None, None, ), # 2 - (3, TType.BOOL, 'disable', None, None, ), # 3 ) -class pltfm_mgr_qsfp_tx_disable_result(object): +class pltfm_mgr_qsfp_reset_get_result(object): """ Attributes: - success @@ -3943,8 +4201,8 @@ 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: @@ -3962,10 +4220,10 @@ 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') + oprot.writeStructBegin('pltfm_mgr_qsfp_reset_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) @@ -3987,9 +4245,305 @@ def __eq__(self, other): 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 +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() + self.ouch.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() + self.ouch.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 ) @@ -4028,7 +4582,295 @@ 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') + 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() + self.ouch.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() + self.ouch.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) @@ -4049,14 +4891,14 @@ def __eq__(self, other): 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 = ( +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_rx_pwr_get_result(object): +class pltfm_mgr_qsfp_chan_tx_pwr_get_result(object): """ Attributes: - success @@ -4081,10 +4923,10 @@ def read(self, iprot): 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) + (_etype17, _size14) = iprot.readListBegin() + for _i18 in range(_size14): + _elem19 = iprot.readDouble() + self.success.append(_elem19) iprot.readListEnd() else: iprot.skip(ftype) @@ -4103,12 +4945,12 @@ 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') + 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 iter6 in self.success: - oprot.writeDouble(iter6) + for iter20 in self.success: + oprot.writeDouble(iter20) oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: @@ -4131,14 +4973,14 @@ def __eq__(self, other): 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 = ( +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_tx_bias_get_args(object): +class pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_args(object): """ Attributes: - port_num @@ -4172,7 +5014,7 @@ 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') + 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) @@ -4193,14 +5035,14 @@ def __eq__(self, other): 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 = ( +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_tx_bias_get_result(object): +class pltfm_mgr_qsfp_chan_rx_pwr_alarm_flags_get_result(object): """ Attributes: - success @@ -4225,10 +5067,11 @@ def read(self, iprot): 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) + (_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) @@ -4247,12 +5090,12 @@ 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') + 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.DOUBLE, len(self.success)) - for iter13 in self.success: - oprot.writeDouble(iter13) + 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: @@ -4275,14 +5118,14 @@ def __eq__(self, other): 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 +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_qsfp_chan_tx_pwr_get_args(object): +class pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_args(object): """ Attributes: - port_num @@ -4316,7 +5159,7 @@ 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') + 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) @@ -4337,14 +5180,14 @@ def __eq__(self, other): 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 = ( +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_qsfp_chan_tx_pwr_get_result(object): +class pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_get_result(object): """ Attributes: - success @@ -4369,10 +5212,11 @@ def read(self, iprot): 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) + (_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) @@ -4391,12 +5235,12 @@ 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') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_bias_alarm_flags_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.writeListBegin(TType.STRUCT, len(self.success)) + for iter34 in self.success: + iter34.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: @@ -4419,14 +5263,14 @@ def __eq__(self, other): 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 +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_qsfp_chan_rx_pwr_alarm_flags_get_args(object): +class pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_args(object): """ Attributes: - port_num @@ -4460,7 +5304,7 @@ 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') + 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) @@ -4481,14 +5325,14 @@ def __eq__(self, other): 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 = ( +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_qsfp_chan_rx_pwr_alarm_flags_get_result(object): +class pltfm_mgr_qsfp_chan_tx_pwr_alarm_flags_get_result(object): """ Attributes: - success @@ -4513,11 +5357,11 @@ def read(self, iprot): 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) + (_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) @@ -4536,12 +5380,12 @@ 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') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_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) + for iter41 in self.success: + iter41.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: @@ -4564,14 +5408,14 @@ def __eq__(self, other): 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 = ( +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_qsfp_chan_tx_bias_alarm_flags_get_args(object): +class pltfm_mgr_qsfp_chan_rx_los_get_args(object): """ Attributes: - port_num @@ -4605,7 +5449,7 @@ 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_alarm_flags_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) @@ -4626,14 +5470,14 @@ 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 = ( +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_qsfp_chan_tx_bias_alarm_flags_get_result(object): +class pltfm_mgr_qsfp_chan_rx_los_get_result(object): """ Attributes: - success @@ -4658,11 +5502,10 @@ def read(self, iprot): if fid == 0: 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) + (_etype45, _size42) = iprot.readListBegin() + for _i46 in range(_size42): + _elem47 = iprot.readBool() + self.success.append(_elem47) iprot.readListEnd() else: iprot.skip(ftype) @@ -4681,12 +5524,12 @@ 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_alarm_flags_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_rx_los_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter34 in self.success: - iter34.write(oprot) + 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: @@ -4709,14 +5552,14 @@ 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 +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_qsfp_chan_tx_pwr_alarm_flags_get_args(object): +class pltfm_mgr_qsfp_chan_tx_los_get_args(object): """ Attributes: - port_num @@ -4750,7 +5593,7 @@ 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_alarm_flags_get_args') + 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) @@ -4771,14 +5614,14 @@ 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 = ( +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_qsfp_chan_tx_pwr_alarm_flags_get_result(object): +class pltfm_mgr_qsfp_chan_tx_los_get_result(object): """ Attributes: - success @@ -4803,11 +5646,10 @@ def read(self, iprot): if fid == 0: 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) + (_etype52, _size49) = iprot.readListBegin() + for _i53 in range(_size49): + _elem54 = iprot.readBool() + self.success.append(_elem54) iprot.readListEnd() else: iprot.skip(ftype) @@ -4826,12 +5668,12 @@ 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_alarm_flags_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_los_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter41 in self.success: - iter41.write(oprot) + 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: @@ -4854,14 +5696,14 @@ 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 +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_qsfp_chan_rx_los_get_args(object): +class pltfm_mgr_qsfp_chan_tx_fault_get_args(object): """ Attributes: - port_num @@ -4895,7 +5737,7 @@ 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_los_get_args') + 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) @@ -4916,14 +5758,14 @@ 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 = ( +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_qsfp_chan_rx_los_get_result(object): +class pltfm_mgr_qsfp_chan_tx_fault_get_result(object): """ Attributes: - success @@ -4948,10 +5790,10 @@ def read(self, iprot): if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype45, _size42) = iprot.readListBegin() - for _i46 in range(_size42): - _elem47 = iprot.readBool() - self.success.append(_elem47) + (_etype59, _size56) = iprot.readListBegin() + for _i60 in range(_size56): + _elem61 = iprot.readBool() + self.success.append(_elem61) iprot.readListEnd() else: iprot.skip(ftype) @@ -4970,12 +5812,12 @@ 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_los_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_chan_tx_fault_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.BOOL, len(self.success)) - for iter48 in self.success: - oprot.writeBool(iter48) + for iter62 in self.success: + oprot.writeBool(iter62) oprot.writeListEnd() oprot.writeFieldEnd() if self.ouch is not None: @@ -4998,14 +5840,14 @@ 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 = ( +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_qsfp_chan_tx_los_get_args(object): +class pltfm_mgr_qsfp_temperature_get_args(object): """ Attributes: - port_num @@ -5039,7 +5881,7 @@ 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_los_get_args') + 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) @@ -5060,14 +5902,14 @@ 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 = ( +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_qsfp_chan_tx_los_get_result(object): +class pltfm_mgr_qsfp_temperature_get_result(object): """ Attributes: - success @@ -5090,13 +5932,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.LIST: - self.success = [] - (_etype52, _size49) = iprot.readListBegin() - for _i53 in range(_size49): - _elem54 = iprot.readBool() - self.success.append(_elem54) - iprot.readListEnd() + if ftype == TType.DOUBLE: + self.success = iprot.readDouble() else: iprot.skip(ftype) elif fid == 1: @@ -5114,13 +5951,10 @@ 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_los_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_temperature_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.BOOL, len(self.success)) - for iter55 in self.success: - oprot.writeBool(iter55) - oprot.writeListEnd() + oprot.writeFieldBegin('success', TType.DOUBLE, 0) + oprot.writeDouble(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -5142,14 +5976,14 @@ 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 +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_qsfp_chan_tx_fault_get_args(object): +class pltfm_mgr_qsfp_voltage_get_args(object): """ Attributes: - port_num @@ -5183,7 +6017,7 @@ 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_fault_get_args') + 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) @@ -5204,14 +6038,14 @@ 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 = ( +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_qsfp_chan_tx_fault_get_result(object): +class pltfm_mgr_qsfp_voltage_get_result(object): """ Attributes: - success @@ -5234,13 +6068,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.LIST: - self.success = [] - (_etype59, _size56) = iprot.readListBegin() - for _i60 in range(_size56): - _elem61 = iprot.readBool() - self.success.append(_elem61) - iprot.readListEnd() + if ftype == TType.DOUBLE: + self.success = iprot.readDouble() else: iprot.skip(ftype) elif fid == 1: @@ -5258,13 +6087,10 @@ 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_fault_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_voltage_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.LIST, 0) - oprot.writeListBegin(TType.BOOL, len(self.success)) - for iter62 in self.success: - oprot.writeBool(iter62) - oprot.writeListEnd() + oprot.writeFieldBegin('success', TType.DOUBLE, 0) + oprot.writeDouble(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -5286,14 +6112,14 @@ 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 +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_qsfp_temperature_get_args(object): +class pltfm_mgr_qsfp_thresholds_get_args(object): """ Attributes: - port_num @@ -5327,7 +6153,7 @@ 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_temperature_get_args') + 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) @@ -5348,14 +6174,14 @@ 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 = ( +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_qsfp_temperature_get_result(object): +class pltfm_mgr_qsfp_thresholds_get_result(object): """ Attributes: - success @@ -5378,8 +6204,9 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.DOUBLE: - self.success = iprot.readDouble() + if ftype == TType.STRUCT: + self.success = pltfm_mgr_qsfp_thresholds_t() + self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: @@ -5397,10 +6224,10 @@ 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_temperature_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_thresholds_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.DOUBLE, 0) - oprot.writeDouble(self.success) + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -5422,23 +6249,25 @@ 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 +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_voltage_get_args(object): +class pltfm_mgr_qsfp_tx_is_disabled_args(object): """ Attributes: - port_num + - channel """ - 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: @@ -5454,6 +6283,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() @@ -5463,11 +6297,15 @@ 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_voltage_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() @@ -5484,14 +6322,15 @@ 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 = ( +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_voltage_get_result(object): +class pltfm_mgr_qsfp_tx_is_disabled_result(object): """ Attributes: - success @@ -5514,8 +6353,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.DOUBLE: - self.success = iprot.readDouble() + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -5533,10 +6372,10 @@ 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_voltage_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_tx_is_disabled_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.DOUBLE, 0) - oprot.writeDouble(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) @@ -5558,14 +6397,14 @@ 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 +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_thresholds_get_args(object): +class pltfm_mgr_qsfp_lpmode_get_args(object): """ Attributes: - port_num @@ -5599,7 +6438,7 @@ 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_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) @@ -5620,14 +6459,14 @@ 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 = ( +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_thresholds_get_result(object): +class pltfm_mgr_qsfp_lpmode_get_result(object): """ Attributes: - success @@ -5650,9 +6489,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_qsfp_thresholds_t() - self.success.read(iprot) + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -5670,10 +6508,10 @@ 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_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_lpmode_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -5695,25 +6533,23 @@ 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 +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_tx_is_disabled_args(object): +class pltfm_mgr_qsfp_pwr_override_get_args(object): """ Attributes: - port_num - - channel """ - def __init__(self, port_num=None, channel=None,): + def __init__(self, port_num=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: @@ -5729,11 +6565,6 @@ 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() @@ -5743,15 +6574,11 @@ 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_is_disabled_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() - if self.channel is not None: - oprot.writeFieldBegin('channel', TType.I32, 2) - oprot.writeI32(self.channel) - oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5768,15 +6595,14 @@ 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 = ( +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 - (2, TType.I32, 'channel', None, None, ), # 2 ) -class pltfm_mgr_qsfp_tx_is_disabled_result(object): +class pltfm_mgr_qsfp_pwr_override_get_result(object): """ Attributes: - success @@ -5818,7 +6644,7 @@ 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_is_disabled_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) @@ -5843,23 +6669,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 = ( +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_lpmode_get_args(object): +class pltfm_mgr_qsfp_pwr_override_set_args(object): """ Attributes: - port_num + - power_override + - power_set """ - def __init__(self, port_num=None,): + def __init__(self, port_num=None, power_override=None, power_set=None,): self.port_num = port_num + 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: @@ -5875,6 +6705,16 @@ def read(self, iprot): self.port_num = iprot.readI32() else: iprot.skip(ftype) + elif fid == -1: + if ftype == TType.BOOL: + self.power_override = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == -2: + if ftype == TType.BOOL: + self.power_set = iprot.readBool() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -5884,7 +6724,15 @@ 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_lpmode_get_args') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_set_args') + if self.power_set is not None: + oprot.writeFieldBegin('power_set', TType.BOOL, -2) + oprot.writeBool(self.power_set) + oprot.writeFieldEnd() + if self.power_override is not None: + oprot.writeFieldBegin('power_override', TType.BOOL, -1) + oprot.writeBool(self.power_override) + oprot.writeFieldEnd() if self.port_num is not None: oprot.writeFieldBegin('port_num', TType.I32, 1) oprot.writeI32(self.port_num) @@ -5905,14 +6753,11 @@ 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 -) +all_structs.append(pltfm_mgr_qsfp_pwr_override_set_args) +pltfm_mgr_qsfp_pwr_override_set_args.thrift_spec = () -class pltfm_mgr_qsfp_lpmode_get_result(object): +class pltfm_mgr_qsfp_pwr_override_set_result(object): """ Attributes: - success @@ -5954,7 +6799,7 @@ 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_lpmode_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_pwr_override_set_result') if self.success is not None: oprot.writeFieldBegin('success', TType.BOOL, 0) oprot.writeBool(self.success) @@ -5979,8 +6824,8 @@ 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 = ( +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 ) 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 78e2f663fe4f..7671375edb47 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 @@ -1111,21 +1111,31 @@ def __ne__(self, other): class pltfm_mgr_qsfp_thresholds_t(object): """ Attributes: - - temp - - vcc - rx_pwr - - tx_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, temp=None, vcc=None, rx_pwr=None, tx_pwr=None, tx_bias=None,): - self.temp = temp - self.vcc = vcc + 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.tx_pwr = tx_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: @@ -1138,20 +1148,20 @@ def read(self, iprot): break if fid == -1: if ftype == TType.STRUCT: - self.temp = pltfm_mgr_qsfp_threshold_t() - self.temp.read(iprot) + 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.vcc = pltfm_mgr_qsfp_threshold_t() - self.vcc.read(iprot) + self.temp = pltfm_mgr_qsfp_threshold_t() + self.temp.read(iprot) else: iprot.skip(ftype) elif fid == -3: if ftype == TType.STRUCT: - self.rx_pwr = pltfm_mgr_qsfp_threshold_t() - self.rx_pwr.read(iprot) + self.tx_bias = pltfm_mgr_qsfp_threshold_t() + self.tx_bias.read(iprot) else: iprot.skip(ftype) elif fid == -4: @@ -1162,8 +1172,33 @@ def read(self, iprot): iprot.skip(ftype) elif fid == -5: if ftype == TType.STRUCT: - self.tx_bias = pltfm_mgr_qsfp_threshold_t() - self.tx_bias.read(iprot) + 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: @@ -1176,26 +1211,46 @@ def write(self, oprot): oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('pltfm_mgr_qsfp_thresholds_t') - if self.tx_bias is not None: - oprot.writeFieldBegin('tx_bias', TType.STRUCT, -5) - self.tx_bias.write(oprot) + if self.vcc_is_set is not None: + oprot.writeFieldBegin('vcc_is_set', TType.BOOL, -10) + oprot.writeBool(self.vcc_is_set) oprot.writeFieldEnd() - if self.tx_pwr is not None: - oprot.writeFieldBegin('tx_pwr', TType.STRUCT, -4) - self.tx_pwr.write(oprot) + 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.rx_pwr is not None: - oprot.writeFieldBegin('rx_pwr', TType.STRUCT, -3) - self.rx_pwr.write(oprot) + 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.temp_is_set is not None: + oprot.writeFieldBegin('temp_is_set', TType.BOOL, -7) + oprot.writeBool(self.temp_is_set) + 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.vcc is not None: - oprot.writeFieldBegin('vcc', TType.STRUCT, -2) + oprot.writeFieldBegin('vcc', TType.STRUCT, -5) self.vcc.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.tx_bias is not None: + oprot.writeFieldBegin('tx_bias', TType.STRUCT, -3) + self.tx_bias.write(oprot) + oprot.writeFieldEnd() if self.temp is not None: - oprot.writeFieldBegin('temp', TType.STRUCT, -1) + oprot.writeFieldBegin('temp', TType.STRUCT, -2) self.temp.write(oprot) oprot.writeFieldEnd() + if self.rx_pwr is not None: + oprot.writeFieldBegin('rx_pwr', TType.STRUCT, -1) + self.rx_pwr.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() 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 730c407d7961..6271ca32b234 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 @@ -279,6 +279,14 @@ def qsfp_ports(): def get_transceiver_change_event(timeout=0): return Sfp.sfputil.get_transceiver_change_event() + def __chan_count_get(self): + def get_qsfp_chan_count(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_chan_count_get(self.index) + err, count = pltfm_mgr_try(get_qsfp_chan_count) + if err: + return None + return int(count) + def __init__(self, port_num): self.index = port_num self.port_num = port_num @@ -307,40 +315,36 @@ def get_transceiver_info(self): def get_transceiver_bulk_status(self): status = dict() + chan_count = self.__chan_count_get() + if chan_count is None: + return None + rx_los = self.get_rx_los() - if rx_los is not None: - status['rx_los'] = any(rx_los) + status['rx_los'] = any(rx_los) if rx_los is not None else 'N/A' tx_fault = self.get_tx_fault() - if tx_fault is not None: - status['tx_fault'] = any(tx_fault) + status['tx_fault'] = any(tx_fault) if tx_fault is not None else 'N/A' + + voltage = self.get_voltage() + status['voltage'] = int(voltage) if voltage is not None else 'N/A' lp_mode = self.get_lpmode() - if lp_mode is not None: - status['lp_mode'] = lp_mode + status['lp_mode'] = lp_mode if lp_mode is not None else 'N/A' temperature = self.get_temperature() - if temperature is not None: - status['temperature'] = temperature - - voltage = self.get_voltage() - if voltage is not None: - status['voltage'] = int(voltage) + status['temperature'] = int(temperature) if temperature is not None else 'N/A' tx_bias = self.get_tx_bias() - if tx_bias is not None: - for n, p in enumerate(tx_bias, 1): - status[f'tx{n}bias'] = int(p) + for n in range(chan_count): + status[f'tx{n + 1}bias'] = int(tx_bias[n]) if tx_bias is not None else 'N/A' tx_power = self.get_tx_power() - if tx_power is not None: - for n, p in enumerate(tx_power, 1): - status[f'tx{n}power'] = int(p) + for n in range(chan_count): + status[f'tx{n + 1}power'] = int(tx_power[n]) if tx_power is not None else 'N/A' rx_power = self.get_rx_power() - if rx_power is not None: - for n, p in enumerate(rx_power, 1): - status[f'rx{n}power'] = int(p) + for n in range(chan_count): + status[f'rx{n + 1}power'] = int(rx_power[n]) if rx_power is not None else 'N/A' return status @@ -521,36 +525,56 @@ def get_qsfp_voltage(pltfm_mgr): voltage_mV = voltage_V * 1000 return voltage_mV + def get_reset_status(self): + def get_qsfp_reset(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_reset_get(self.index) + err, status = pltfm_mgr_try(get_qsfp_reset, False) + return status + + def get_power_override(self): + def get_qsfp_power_override(pltfm_mgr): + return pltfm_mgr.pltfm_mgr_qsfp_pwr_override_get(self.index) + err, 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 + ) + err, status = pltfm_mgr_try(set_qsfp_power_override) + return status + def get_transceiver_threshold_info(self): def qsfp_thres_info(pltfm_mgr): return pltfm_mgr.pltfm_mgr_qsfp_thresholds_get(self.index) - err, pltfm_info = pltfm_mgr_try(qsfp_thres_info) + err, ths = pltfm_mgr_try(qsfp_thres_info) if err: return None info = dict() - info['rxpowerhighalarm'] = pltfm_info.rx_pwr.highalarm - info['rxpowerhighwarning'] = pltfm_info.rx_pwr.lowalarm - info['rxpowerlowalarm'] = pltfm_info.rx_pwr.highwarning - info['rxpowerlowwarning'] = pltfm_info.rx_pwr.lowwarning - info['temphighalarm'] = pltfm_info.temp.highalarm - info['temphighwarning'] = pltfm_info.temp.lowalarm - info['templowalarm'] = pltfm_info.temp.highwarning - info['templowwarning'] = pltfm_info.temp.lowwarning - info['txbiashighalarm'] = pltfm_info.tx_bias.highalarm - info['txbiashighwarning'] = pltfm_info.tx_bias.lowalarm - info['txbiaslowalarm'] = pltfm_info.tx_bias.highwarning - info['txbiaslowwarning'] = pltfm_info.tx_bias.lowwarning - info['txpowerhighalarm'] = pltfm_info.tx_pwr.highalarm - info['txpowerhighwarning'] = pltfm_info.tx_pwr.lowalarm - info['txpowerlowalarm'] = pltfm_info.tx_pwr.highwarning - info['txpowerlowwarning'] = pltfm_info.tx_pwr.lowwarning - info['vcchighalarm'] = pltfm_info.vcc.highalarm - info['vcchighwarning'] = pltfm_info.vcc.lowalarm - info['vcclowalarm'] = pltfm_info.vcc.highwarning - info['vcclowwarning'] = pltfm_info.vcc.lowwarning + info['rxpowerhighalarm'] = ths.rx_pwr.highalarm if ths.rx_pwr_is_set else 'N/A' + info['rxpowerhighwarning'] = ths.rx_pwr.lowalarm if ths.rx_pwr_is_set else 'N/A' + info['rxpowerlowalarm'] = ths.rx_pwr.highwarning if ths.rx_pwr_is_set else 'N/A' + info['rxpowerlowwarning'] = ths.rx_pwr.lowwarning if ths.rx_pwr_is_set else 'N/A' + info['temphighalarm'] = ths.temp.highalarm if ths.temp_is_set else 'N/A' + info['temphighwarning'] = ths.temp.lowalarm if ths.temp_is_set else 'N/A' + info['templowalarm'] = ths.temp.highwarning if ths.temp_is_set else 'N/A' + info['templowwarning'] = ths.temp.lowwarning if ths.temp_is_set else 'N/A' + info['txbiashighalarm'] = ths.tx_bias.highalarm if ths.tx_bias_is_set else 'N/A' + info['txbiashighwarning'] = ths.tx_bias.lowalarm if ths.tx_bias_is_set else 'N/A' + info['txbiaslowalarm'] = ths.tx_bias.highwarning if ths.tx_bias_is_set else 'N/A' + info['txbiaslowwarning'] = ths.tx_bias.lowwarning if ths.tx_bias_is_set else 'N/A' + info['txpowerhighalarm'] = ths.tx_pwr.highalarm if ths.tx_pwr_is_set else 'N/A' + info['txpowerhighwarning'] = ths.tx_pwr.lowalarm if ths.tx_pwr_is_set else 'N/A' + info['txpowerlowalarm'] = ths.tx_pwr.highwarning if ths.tx_pwr_is_set else 'N/A' + info['txpowerlowwarning'] = ths.tx_pwr.lowwarning if ths.tx_pwr_is_set else 'N/A' + info['vcchighalarm'] = ths.vcc.highalarm if ths.vcc_is_set else 'N/A' + info['vcchighwarning'] = ths.vcc.lowalarm if ths.vcc_is_set else 'N/A' + info['vcclowalarm'] = ths.vcc.highwarning if ths.vcc_is_set else 'N/A' + info['vcclowwarning'] = ths.vcc.lowwarning if ths.vcc_is_set else 'N/A' return info