From 82f1a7eb5535b30a95b1e71ff18c315d40d1e6f0 Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Fri, 29 Jan 2016 16:00:57 -0800 Subject: OpenContrail test suite Change-Id: I61168093a2a05d47377ef47c8638ae1554b1a999 Signed-off-by: Stuart Mackie --- Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py | 1281 ++++++++++++++++++++++ 1 file changed, 1281 insertions(+) create mode 100644 Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py (limited to 'Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py') diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py new file mode 100644 index 0000000..ce6e3ae --- /dev/null +++ b/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py @@ -0,0 +1,1281 @@ +# +# Autogenerated by Sandesh Compiler (1.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:new_style +# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. +# + +from pysandesh.Thrift import TType, TMessageType, TException +import cpuinfo.ttypes +import process_info.ttypes + + +from pysandesh.transport import TTransport +from pysandesh.protocol import TBinaryProtocol, TProtocol +try: + from pysandesh.protocol import fastbinary +except: + fastbinary = None + +import cStringIO +import uuid +import bottle +from pysandesh import sandesh_base +from pysandesh.sandesh_http import SandeshHttp +from pysandesh.sandesh_uve import SandeshUVETypeMaps +from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString +from pysandesh.gen_py.sandesh.constants import * + + + +class ModuleCpuInfo(object): + """ + Attributes: + - module_id + - cpu_info + - instance_id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'module_id', None, None, ), # 1 + (2, TType.STRUCT, 'cpu_info', (cpuinfo.ttypes.CpuLoadInfo, cpuinfo.ttypes.CpuLoadInfo.thrift_spec), None, ), # 2 + (3, TType.STRING, 'instance_id', None, None, ), # 3 + ) + + def __init__(self, module_id=None, cpu_info=None, instance_id=None,): + self.module_id = module_id + self.cpu_info = cpu_info + self.instance_id = instance_id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return 0 + read_cnt = 0 + length = iprot.readStructBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + (length, self.module_id) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.cpu_info = cpuinfo.ttypes.CpuLoadInfo() + read_cnt += self.cpu_info.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + (length, self.instance_id) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readStructEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeStructBegin('ModuleCpuInfo') < 0: return -1 + if self.module_id is not None: + annotations = {} + if oprot.writeFieldBegin('module_id', TType.STRING, 1, annotations) < 0: return -1 + if oprot.writeString(self.module_id) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.cpu_info is not None: + annotations = {} + if oprot.writeFieldBegin('cpu_info', TType.STRUCT, 2, annotations) < 0: return -1 + if self.cpu_info.write(oprot) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.instance_id is not None: + annotations = {} + if oprot.writeFieldBegin('instance_id', TType.STRING, 3, annotations) < 0: return -1 + if oprot.writeString(self.instance_id) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeStructEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def log(self): + log_str = cStringIO.StringIO() + if self.module_id is not None: + log_str.write('module_id = ') + log_str.write(self.module_id) + log_str.write(' ') + if self.cpu_info is not None: + log_str.write('cpu_info = ') + log_str.write('<< ') + log_str.write(self.cpu_info.log()) + log_str.write('>>') + log_str.write(' ') + if self.instance_id is not None: + log_str.write('instance_id = ') + log_str.write(self.instance_id) + log_str.write(' ') + return log_str.getvalue() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 ModuleCpuState(object): + """ + Attributes: + - name + - deleted + - module_cpu_info + - build_info + - config_node_ip + - api_server_cpu_share + - schema_xmer_cpu_share + - service_monitor_cpu_share + - api_server_mem_virt + - schema_xmer_mem_virt + - service_monitor_mem_virt + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.BOOL, 'deleted', None, None, ), # 2 + (3, TType.LIST, 'module_cpu_info', (TType.STRUCT,(ModuleCpuInfo, ModuleCpuInfo.thrift_spec)), None, ), # 3 + (4, TType.STRING, 'build_info', None, None, ), # 4 + (5, TType.LIST, 'config_node_ip', (TType.STRING,None), None, ), # 5 + (6, TType.DOUBLE, 'api_server_cpu_share', None, None, ), # 6 + (7, TType.DOUBLE, 'schema_xmer_cpu_share', None, None, ), # 7 + (8, TType.DOUBLE, 'service_monitor_cpu_share', None, None, ), # 8 + (9, TType.U32, 'api_server_mem_virt', None, None, ), # 9 + (10, TType.U32, 'schema_xmer_mem_virt', None, None, ), # 10 + (11, TType.U32, 'service_monitor_mem_virt', None, None, ), # 11 + ) + + def __init__(self, name=None, deleted=None, module_cpu_info=None, build_info=None, config_node_ip=None, api_server_cpu_share=None, schema_xmer_cpu_share=None, service_monitor_cpu_share=None, api_server_mem_virt=None, schema_xmer_mem_virt=None, service_monitor_mem_virt=None,): + self.name = name + self.deleted = deleted + self.module_cpu_info = module_cpu_info + self.build_info = build_info + self.config_node_ip = config_node_ip + self.api_server_cpu_share = api_server_cpu_share + self.schema_xmer_cpu_share = schema_xmer_cpu_share + self.service_monitor_cpu_share = service_monitor_cpu_share + self.api_server_mem_virt = api_server_mem_virt + self.schema_xmer_mem_virt = schema_xmer_mem_virt + self.service_monitor_mem_virt = service_monitor_mem_virt + self._table = 'ObjectConfigNode' + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return 0 + read_cnt = 0 + length = iprot.readStructBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + (length, self.name) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + (length, self.deleted) = iprot.readBool(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.module_cpu_info = [] + (length, _etype3, _size0) = iprot.readListBegin() + read_cnt += length + for _i4 in xrange(_size0): + _elem5 = ModuleCpuInfo() + read_cnt += _elem5.read(iprot) + self.module_cpu_info.append(_elem5) + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + (length, self.build_info) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.LIST: + self.config_node_ip = [] + (length, _etype9, _size6) = iprot.readListBegin() + read_cnt += length + for _i10 in xrange(_size6): + read_cnt += iprot.readContainerElementBegin() + (length, _elem11) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + self.config_node_ip.append(_elem11) + read_cnt += iprot.readContainerElementEnd() + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.DOUBLE: + (length, self.api_server_cpu_share) = iprot.readDouble(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.DOUBLE: + (length, self.schema_xmer_cpu_share) = iprot.readDouble(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.DOUBLE: + (length, self.service_monitor_cpu_share) = iprot.readDouble(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.U32: + (length, self.api_server_mem_virt) = iprot.readU32(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.U32: + (length, self.schema_xmer_mem_virt) = iprot.readU32(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 11: + if ftype == TType.U32: + (length, self.service_monitor_mem_virt) = iprot.readU32(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readStructEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeStructBegin('ModuleCpuState') < 0: return -1 + if self.name is not None: + annotations = {} + if self._table is None or self._table is '': return -1 + annotations['key'] = self._table + if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1 + if oprot.writeString(self.name) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.deleted is not None: + annotations = {} + if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1 + if oprot.writeBool(self.deleted) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.module_cpu_info is not None: + annotations = {} + annotations['aggtype'] = 'union' + if oprot.writeFieldBegin('module_cpu_info', TType.LIST, 3, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRUCT, len(self.module_cpu_info)) < 0: return -1 + for iter12 in self.module_cpu_info: + if iter12.write(oprot) < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.build_info is not None: + annotations = {} + if oprot.writeFieldBegin('build_info', TType.STRING, 4, annotations) < 0: return -1 + if oprot.writeString(self.build_info) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.config_node_ip is not None: + annotations = {} + if oprot.writeFieldBegin('config_node_ip', TType.LIST, 5, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRING, len(self.config_node_ip)) < 0: return -1 + for iter13 in self.config_node_ip: + if oprot.writeContainerElementBegin() < 0: return -1 + if oprot.writeString(iter13) < 0: return -1 + if oprot.writeContainerElementEnd() < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.api_server_cpu_share is not None: + annotations = {} + annotations['aggtype'] = 'stats' + if oprot.writeFieldBegin('api_server_cpu_share', TType.DOUBLE, 6, annotations) < 0: return -1 + if oprot.writeDouble(self.api_server_cpu_share) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.schema_xmer_cpu_share is not None: + annotations = {} + annotations['aggtype'] = 'stats' + if oprot.writeFieldBegin('schema_xmer_cpu_share', TType.DOUBLE, 7, annotations) < 0: return -1 + if oprot.writeDouble(self.schema_xmer_cpu_share) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.service_monitor_cpu_share is not None: + annotations = {} + annotations['aggtype'] = 'stats' + if oprot.writeFieldBegin('service_monitor_cpu_share', TType.DOUBLE, 8, annotations) < 0: return -1 + if oprot.writeDouble(self.service_monitor_cpu_share) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.api_server_mem_virt is not None: + annotations = {} + annotations['aggtype'] = 'stats' + annotations['hbin'] = '100000' + if oprot.writeFieldBegin('api_server_mem_virt', TType.U32, 9, annotations) < 0: return -1 + if oprot.writeU32(self.api_server_mem_virt) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.schema_xmer_mem_virt is not None: + annotations = {} + annotations['aggtype'] = 'stats' + annotations['hbin'] = '100000' + if oprot.writeFieldBegin('schema_xmer_mem_virt', TType.U32, 10, annotations) < 0: return -1 + if oprot.writeU32(self.schema_xmer_mem_virt) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.service_monitor_mem_virt is not None: + annotations = {} + annotations['aggtype'] = 'stats' + annotations['hbin'] = '100000' + if oprot.writeFieldBegin('service_monitor_mem_virt', TType.U32, 11, annotations) < 0: return -1 + if oprot.writeU32(self.service_monitor_mem_virt) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeStructEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def log(self): + log_str = cStringIO.StringIO() + if self.name is not None: + log_str.write('name = ') + log_str.write(self.name) + log_str.write(' ') + if self.deleted is not None: + log_str.write('deleted = ') + if self.deleted: + log_str.write('True') + else: + log_str.write('False') + log_str.write(' ') + if self.module_cpu_info is not None: + log_str.write('module_cpu_info = ') + log_str.write('[ ') + for iter14 in self.module_cpu_info: + log_str.write('<< ') + log_str.write(iter14.log()) + log_str.write('>>') + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + if self.build_info is not None: + log_str.write('build_info = ') + log_str.write(self.build_info) + log_str.write(' ') + if self.config_node_ip is not None: + log_str.write('config_node_ip = ') + log_str.write('[ ') + for iter15 in self.config_node_ip: + log_str.write(iter15) + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + if self.api_server_cpu_share is not None: + log_str.write('api_server_cpu_share = ') + log_str.write(str(self.api_server_cpu_share)) + log_str.write(' ') + if self.schema_xmer_cpu_share is not None: + log_str.write('schema_xmer_cpu_share = ') + log_str.write(str(self.schema_xmer_cpu_share)) + log_str.write(' ') + if self.service_monitor_cpu_share is not None: + log_str.write('service_monitor_cpu_share = ') + log_str.write(str(self.service_monitor_cpu_share)) + log_str.write(' ') + if self.api_server_mem_virt is not None: + log_str.write('api_server_mem_virt = ') + log_str.write(str(self.api_server_mem_virt)) + log_str.write(' ') + if self.schema_xmer_mem_virt is not None: + log_str.write('schema_xmer_mem_virt = ') + log_str.write(str(self.schema_xmer_mem_virt)) + log_str.write(' ') + if self.service_monitor_mem_virt is not None: + log_str.write('service_monitor_mem_virt = ') + log_str.write(str(self.service_monitor_mem_virt)) + log_str.write(' ') + return log_str.getvalue() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 ConfigCpuState(object): + """ + Attributes: + - name + - deleted + - cpu_info + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.BOOL, 'deleted', None, None, ), # 2 + (3, TType.LIST, 'cpu_info', (TType.STRUCT,(cpuinfo.ttypes.ProcessCpuInfo, cpuinfo.ttypes.ProcessCpuInfo.thrift_spec)), None, ), # 3 + ) + + def __init__(self, name=None, deleted=None, cpu_info=None,): + self.name = name + self.deleted = deleted + self.cpu_info = cpu_info + self._table = 'ObjectConfigNode' + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return 0 + read_cnt = 0 + length = iprot.readStructBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + (length, self.name) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + (length, self.deleted) = iprot.readBool(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.cpu_info = [] + (length, _etype19, _size16) = iprot.readListBegin() + read_cnt += length + for _i20 in xrange(_size16): + _elem21 = cpuinfo.ttypes.ProcessCpuInfo() + read_cnt += _elem21.read(iprot) + self.cpu_info.append(_elem21) + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readStructEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeStructBegin('ConfigCpuState') < 0: return -1 + if self.name is not None: + annotations = {} + if self._table is None or self._table is '': return -1 + annotations['key'] = self._table + if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1 + if oprot.writeString(self.name) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.deleted is not None: + annotations = {} + if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1 + if oprot.writeBool(self.deleted) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.cpu_info is not None: + annotations = {} + annotations['aggtype'] = 'union' + annotations['tags'] = '.module_id,.mem_virt,.cpu_share,.mem_res' + if oprot.writeFieldBegin('cpu_info', TType.LIST, 3, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRUCT, len(self.cpu_info)) < 0: return -1 + for iter22 in self.cpu_info: + if iter22.write(oprot) < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeStructEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def log(self): + log_str = cStringIO.StringIO() + if self.name is not None: + log_str.write('name = ') + log_str.write(self.name) + log_str.write(' ') + if self.deleted is not None: + log_str.write('deleted = ') + if self.deleted: + log_str.write('True') + else: + log_str.write('False') + log_str.write(' ') + if self.cpu_info is not None: + log_str.write('cpu_info = ') + log_str.write('[ ') + for iter23 in self.cpu_info: + log_str.write('<< ') + log_str.write(iter23.log()) + log_str.write('>>') + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + return log_str.getvalue() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 NodeStatus(object): + """ + Attributes: + - name + - deleted + - status + - process_status + - process_info + - disk_usage_info + - description + - all_core_file_list + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.BOOL, 'deleted', None, None, ), # 2 + (3, TType.STRING, 'status', None, None, ), # 3 + (4, TType.LIST, 'process_status', (TType.STRUCT,(process_info.ttypes.ProcessStatus, process_info.ttypes.ProcessStatus.thrift_spec)), None, ), # 4 + (5, TType.LIST, 'process_info', (TType.STRUCT,(process_info.ttypes.ProcessInfo, process_info.ttypes.ProcessInfo.thrift_spec)), None, ), # 5 + (6, TType.LIST, 'disk_usage_info', (TType.STRUCT,(process_info.ttypes.DiskPartitionUsageStats, process_info.ttypes.DiskPartitionUsageStats.thrift_spec)), None, ), # 6 + (7, TType.STRING, 'description', None, None, ), # 7 + (8, TType.LIST, 'all_core_file_list', (TType.STRING,None), None, ), # 8 + ) + + def __init__(self, name=None, deleted=None, status=None, process_status=None, process_info=None, disk_usage_info=None, description=None, all_core_file_list=None,): + self.name = name + self.deleted = deleted + self.status = status + self.process_status = process_status + self.process_info = process_info + self.disk_usage_info = disk_usage_info + self.description = description + self.all_core_file_list = all_core_file_list + self._table = 'ObjectConfigNode' + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return 0 + read_cnt = 0 + length = iprot.readStructBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + (length, self.name) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + (length, self.deleted) = iprot.readBool(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + (length, self.status) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.process_status = [] + (length, _etype27, _size24) = iprot.readListBegin() + read_cnt += length + for _i28 in xrange(_size24): + _elem29 = process_info.ttypes.ProcessStatus() + read_cnt += _elem29.read(iprot) + self.process_status.append(_elem29) + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.LIST: + self.process_info = [] + (length, _etype33, _size30) = iprot.readListBegin() + read_cnt += length + for _i34 in xrange(_size30): + _elem35 = process_info.ttypes.ProcessInfo() + read_cnt += _elem35.read(iprot) + self.process_info.append(_elem35) + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.LIST: + self.disk_usage_info = [] + (length, _etype39, _size36) = iprot.readListBegin() + read_cnt += length + for _i40 in xrange(_size36): + _elem41 = process_info.ttypes.DiskPartitionUsageStats() + read_cnt += _elem41.read(iprot) + self.disk_usage_info.append(_elem41) + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + (length, self.description) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.LIST: + self.all_core_file_list = [] + (length, _etype45, _size42) = iprot.readListBegin() + read_cnt += length + for _i46 in xrange(_size42): + read_cnt += iprot.readContainerElementBegin() + (length, _elem47) = iprot.readString(); + if length < 0: return -1 + read_cnt += length + self.all_core_file_list.append(_elem47) + read_cnt += iprot.readContainerElementEnd() + read_cnt += iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readStructEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeStructBegin('NodeStatus') < 0: return -1 + if self.name is not None: + annotations = {} + if self._table is None or self._table is '': return -1 + annotations['key'] = self._table + if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1 + if oprot.writeString(self.name) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.deleted is not None: + annotations = {} + if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1 + if oprot.writeBool(self.deleted) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.status is not None: + annotations = {} + if oprot.writeFieldBegin('status', TType.STRING, 3, annotations) < 0: return -1 + if oprot.writeString(self.status) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.process_status is not None: + annotations = {} + annotations['aggtype'] = 'union' + if oprot.writeFieldBegin('process_status', TType.LIST, 4, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRUCT, len(self.process_status)) < 0: return -1 + for iter48 in self.process_status: + if iter48.write(oprot) < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.process_info is not None: + annotations = {} + annotations['aggtype'] = 'union' + if oprot.writeFieldBegin('process_info', TType.LIST, 5, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRUCT, len(self.process_info)) < 0: return -1 + for iter49 in self.process_info: + if iter49.write(oprot) < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.disk_usage_info is not None: + annotations = {} + annotations['tags'] = '' + if oprot.writeFieldBegin('disk_usage_info', TType.LIST, 6, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRUCT, len(self.disk_usage_info)) < 0: return -1 + for iter50 in self.disk_usage_info: + if iter50.write(oprot) < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.description is not None: + annotations = {} + if oprot.writeFieldBegin('description', TType.STRING, 7, annotations) < 0: return -1 + if oprot.writeString(self.description) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if self.all_core_file_list is not None: + annotations = {} + if oprot.writeFieldBegin('all_core_file_list', TType.LIST, 8, annotations) < 0: return -1 + if oprot.writeListBegin(TType.STRING, len(self.all_core_file_list)) < 0: return -1 + for iter51 in self.all_core_file_list: + if oprot.writeContainerElementBegin() < 0: return -1 + if oprot.writeString(iter51) < 0: return -1 + if oprot.writeContainerElementEnd() < 0: return -1 + if oprot.writeListEnd() < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeStructEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def log(self): + log_str = cStringIO.StringIO() + if self.name is not None: + log_str.write('name = ') + log_str.write(self.name) + log_str.write(' ') + if self.deleted is not None: + log_str.write('deleted = ') + if self.deleted: + log_str.write('True') + else: + log_str.write('False') + log_str.write(' ') + if self.status is not None: + log_str.write('status = ') + log_str.write(self.status) + log_str.write(' ') + if self.process_status is not None: + log_str.write('process_status = ') + log_str.write('[ ') + for iter52 in self.process_status: + log_str.write('<< ') + log_str.write(iter52.log()) + log_str.write('>>') + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + if self.process_info is not None: + log_str.write('process_info = ') + log_str.write('[ ') + for iter53 in self.process_info: + log_str.write('<< ') + log_str.write(iter53.log()) + log_str.write('>>') + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + if self.disk_usage_info is not None: + log_str.write('disk_usage_info = ') + log_str.write('[ ') + for iter54 in self.disk_usage_info: + log_str.write('<< ') + log_str.write(iter54.log()) + log_str.write('>>') + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + if self.description is not None: + log_str.write('description = ') + log_str.write(self.description) + log_str.write(' ') + if self.all_core_file_list is not None: + log_str.write('all_core_file_list = ') + log_str.write('[ ') + for iter55 in self.all_core_file_list: + log_str.write(iter55) + log_str.write(', ') + log_str.write(' ]') + log_str.write(' ') + return log_str.getvalue() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 ModuleCpuStateTrace(sandesh_base.SandeshUVE): + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'data', (ModuleCpuState, ModuleCpuState.thrift_spec), None, ), # 1 + ) + + def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global): + sandesh_base.SandeshUVE.__init__(self) + self.data = data + self._scope = sandesh.scope() + self._module = sandesh.module() + self._source = sandesh.source_id() + self._node_type = sandesh.node_type() + self._instance_id = sandesh.instance_id() + self._seqnum = 0 + self._timestamp = UTCTimestampUsec() + self._versionsig = 3681498004 + self._hints = 0 | SANDESH_KEY_HINT + if table is not None: + self.data._table = table + + def update_uve(self, tdata): + if self.data.name is not None: + tdata.name = self.data.name + if self.data.deleted is not None: + tdata.deleted = self.data.deleted + if self.data.module_cpu_info is not None: + tdata.module_cpu_info = self.data.module_cpu_info + if self.data.build_info is not None: + tdata.build_info = self.data.build_info + if self.data.config_node_ip is not None: + tdata.config_node_ip = self.data.config_node_ip + if self.data.api_server_cpu_share is not None: + tdata.api_server_cpu_share = self.data.api_server_cpu_share + if self.data.schema_xmer_cpu_share is not None: + tdata.schema_xmer_cpu_share = self.data.schema_xmer_cpu_share + if self.data.service_monitor_cpu_share is not None: + tdata.service_monitor_cpu_share = self.data.service_monitor_cpu_share + if self.data.api_server_mem_virt is not None: + tdata.api_server_mem_virt = self.data.api_server_mem_virt + if self.data.schema_xmer_mem_virt is not None: + tdata.schema_xmer_mem_virt = self.data.schema_xmer_mem_virt + if self.data.service_monitor_mem_virt is not None: + tdata.service_monitor_mem_virt = self.data.service_monitor_mem_virt + return tdata + + def log(self, trace=False): + log_str = cStringIO.StringIO() + if trace: + log_str.write(str(self._timestamp)) + log_str.write(' ') + log_str.write('ModuleCpuStateTrace: ') + if self.data is not None: + log_str.write('data = ') + log_str.write('<< ') + log_str.write(self.data.log()) + log_str.write('>>') + log_str.write(' ') + return log_str.getvalue() + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return -1 + read_cnt = 0 + (length, sandesh_name) = iprot.readSandeshBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.data = ModuleCpuState() + read_cnt += self.data.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readSandeshEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeSandeshBegin('ModuleCpuStateTrace') < 0: return -1 + if self.data is not None: + annotations = {} + if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1 + if self.data.write(oprot) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeSandeshEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def compare(self, other): + if not isinstance(other, self.__class__): + return False + if self.data != other.data: + return False + return True + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 ConfigCpuStateTrace(sandesh_base.SandeshUVE): + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'data', (ConfigCpuState, ConfigCpuState.thrift_spec), None, ), # 1 + ) + + def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global): + sandesh_base.SandeshUVE.__init__(self) + self.data = data + self._scope = sandesh.scope() + self._module = sandesh.module() + self._source = sandesh.source_id() + self._node_type = sandesh.node_type() + self._instance_id = sandesh.instance_id() + self._seqnum = 0 + self._timestamp = UTCTimestampUsec() + self._versionsig = 3278957034 + self._hints = 0 | SANDESH_KEY_HINT + if table is not None: + self.data._table = table + + def update_uve(self, tdata): + if self.data.name is not None: + tdata.name = self.data.name + if self.data.deleted is not None: + tdata.deleted = self.data.deleted + if self.data.cpu_info is not None: + tdata.cpu_info = self.data.cpu_info + return tdata + + def log(self, trace=False): + log_str = cStringIO.StringIO() + if trace: + log_str.write(str(self._timestamp)) + log_str.write(' ') + log_str.write('ConfigCpuStateTrace: ') + if self.data is not None: + log_str.write('data = ') + log_str.write('<< ') + log_str.write(self.data.log()) + log_str.write('>>') + log_str.write(' ') + return log_str.getvalue() + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return -1 + read_cnt = 0 + (length, sandesh_name) = iprot.readSandeshBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.data = ConfigCpuState() + read_cnt += self.data.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readSandeshEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeSandeshBegin('ConfigCpuStateTrace') < 0: return -1 + if self.data is not None: + annotations = {} + if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1 + if self.data.write(oprot) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeSandeshEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def compare(self, other): + if not isinstance(other, self.__class__): + return False + if self.data != other.data: + return False + return True + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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 NodeStatusUVE(sandesh_base.SandeshUVE): + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'data', (NodeStatus, NodeStatus.thrift_spec), None, ), # 1 + ) + + def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global): + sandesh_base.SandeshUVE.__init__(self) + self.data = data + self._scope = sandesh.scope() + self._module = sandesh.module() + self._source = sandesh.source_id() + self._node_type = sandesh.node_type() + self._instance_id = sandesh.instance_id() + self._seqnum = 0 + self._timestamp = UTCTimestampUsec() + self._versionsig = 2778367443 + self._hints = 0 | SANDESH_KEY_HINT + if table is not None: + self.data._table = table + + def update_uve(self, tdata): + if self.data.name is not None: + tdata.name = self.data.name + if self.data.deleted is not None: + tdata.deleted = self.data.deleted + if self.data.status is not None: + tdata.status = self.data.status + if self.data.process_status is not None: + tdata.process_status = self.data.process_status + if self.data.process_info is not None: + tdata.process_info = self.data.process_info + if self.data.disk_usage_info is not None: + tdata.disk_usage_info = self.data.disk_usage_info + if self.data.description is not None: + tdata.description = self.data.description + if self.data.all_core_file_list is not None: + tdata.all_core_file_list = self.data.all_core_file_list + return tdata + + def log(self, trace=False): + log_str = cStringIO.StringIO() + if trace: + log_str.write(str(self._timestamp)) + log_str.write(' ') + log_str.write('NodeStatusUVE: ') + if self.data is not None: + log_str.write('data = ') + log_str.write('<< ') + log_str.write(self.data.log()) + log_str.write('>>') + log_str.write(' ') + return log_str.getvalue() + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return -1 + read_cnt = 0 + (length, sandesh_name) = iprot.readSandeshBegin() + if length < 0: return -1 + read_cnt += length + while True: + (length, fname, ftype, fid) = iprot.readFieldBegin() + if length < 0: return -1 + read_cnt += length + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.data = NodeStatus() + read_cnt += self.data.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + length = iprot.readFieldEnd() + if length < 0: return -1 + read_cnt += length + length = iprot.readSandeshEnd() + if length < 0: return -1 + read_cnt += length + return read_cnt + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return 0 + if oprot.writeSandeshBegin('NodeStatusUVE') < 0: return -1 + if self.data is not None: + annotations = {} + if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1 + if self.data.write(oprot) < 0: return -1 + if oprot.writeFieldEnd() < 0: return -1 + if oprot.writeFieldStop() < 0: return -1 + if oprot.writeSandeshEnd() < 0: return -1 + return 0 + + def validate(self): + return + + + def compare(self, other): + if not isinstance(other, self.__class__): + return False + if self.data != other.data: + return False + return True + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + 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) + + +_SANDESH_REQUEST_LIST = [ +] + + +_SANDESH_UVE_LIST = [ +'ModuleCpuStateTrace', +'ConfigCpuStateTrace', +'NodeStatusUVE', +] + + +_SANDESH_UVE_DATA_LIST = [ +'ModuleCpuState', +'ConfigCpuState', +'NodeStatus', +] + + +_SANDESH_ALARM_LIST = [ +] + + +_SANDESH_ALARM_DATA_LIST = [ +] -- cgit 1.2.3-korg