class Subrack(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64), default='test') box_id = db.Column(db.Integer, db.ForeignKey('box.id')) cards = db.relationship('Card', backref='Subrack', lazy='dynamic') mgmt_cards = db.relationship('MgmtCard', backref='Subrack', lazy='dynamic') # data description = db.Column(db.String(), default='') planned_type = db.Column(db.Enum('rvxs-a', 'not-planned', 'planned', 'nfxs-f'), default='not-planned') actual_type = db.Column(db.Enum('rvxs-a', 'not-planned', 'planned', 'nfxs-f'), default='not-planned') admin_state = db.Column(db.Enum('0', '1'), default='0') # 0 => lock, 1 => unlock operational_state = db.Column(db.Enum('0', '1'), default='0') # 0 => disabled, 1 => enabled err_state = db.Column(db.Enum('no-error', 'error'), default='no-error') availability = db.Column(db.Enum('available', 'unavailable', 'not-installed'), default='not-installed') mode = db.Column(db.Enum('no-extended-lt-slots', 'extended-lt-slots'), default='extended-lt-slots') subrack_class = db.Column(db.Enum('main-ethernet', 'main-copper'), default='main-copper') serial_no = db.Column(db.String(), default='NOT_AVAILABLE') variant = db.Column(db.String(), default='NOT_AVAILABLE') ics = db.Column(db.String(), default='NOT_AVAILABLE') #huawei frame_status = db.Column(db.Enum('active', 'inactive'), default='active') temperature = db.Column(db.String(), default='51C')
class PortGroupPort(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) operational_state = db.Column(db.Enum('1', '0'), default='0') # 0 => down, 1 => up admin_state = db.Column(db.Enum('1', '0'), default='0') description = db.Column(db.String(), default='') label1 = db.Column(db.String(), default='""') label2 = db.Column(db.String(), default='""') card_id = db.Column(db.Integer, db.ForeignKey('card.id')) type = db.Column(db.Enum('ISDN', 'PSTN'), default='ISDN') subscribers = db.relationship('Subscriber', backref='PortGroupPort', lazy='dynamic') #isdn enable = db.Column(db.Boolean(), default=False) register_as_global = db.Column(db.Boolean, default=True) register_default_number_only = db.Column(db.Boolean, default=False) layer_1_permanently_activated = db.Column(db.Boolean, default=False) sip_profile = db.Column(db.String(), default='none') proxy_registrar_profile = db.Column(db.String(), default='none') codec_sdp_profile = db.Column(db.String(), default='none') isdnba_profile = db.Column(db.String(), default='none') #pstn pay_phone = db.Column(db.Boolean(), default=False) pstn_profile = db.Column(db.String(), default='none') enterprise_profile = db.Column(db.String(), default='none')
class Cpe(db.Model): id = db.Column(db.Integer(), primary_key=True) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) port_id = db.Column(db.Integer, db.ForeignKey('port.id'), nullable=True) ont_port_id = db.Column(db.Integer, db.ForeignKey('ont_port.id'), nullable=True) cpe_ports = db.relationship('CpePort', backref='Cpe', lazy='dynamic') name = db.Column(db.String(64)) serial_no = db.Column(db.String(), default='ABCD123456EF') admin_state = db.Column(db.Enum('0', '1'), default='0') # 0 => down, 1 => up description = db.Column(db.String()) mac = db.Column(db.String(64), nullable=False) # Huawei specific data fields g_994_1_vendor_id = db.Column(db.String(), default='0xB5004946544E590C') g_994_1_country_code = db.Column(db.String(), default='0xB500') g_994_1_provider_code = db.Column(db.String(), default='IFTN') g_994_1_vendor_info = db.Column(db.String(), default='0x590C') system_vendor_id = db.Column(db.String(), default='0x040041564D000000') system_country_code = db.Column(db.String(), default='0x0400') system_provider_code = db.Column(db.String(), default='AVM') system_vendor_info = db.Column(db.String(), default='0x0000') version_number = db.Column(db.String(), default='1.180.129.93 AB') version_number_oct = db.Column(db.String(), default='0x312E3138302E3132392E393320414200') vendor_serial_number = db.Column(db.String(), default='444E6DCD4770 F!Box7530 164.07.14') self_test_result = db.Column(db.Enum('PASS'), default='PASS') # find corresponding value(s)
class OntPort(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) description = db.Column(db.String()) operational_state = db.Column( db.Enum('0', '1'), default='0' ) # Alcatel: 0 => down, 1 => up; Huawei: 0 => offline, 1 => online admin_state = db.Column( db.Enum('0', '1', '2'), default='0' ) # Alcatel: 0 => down, 1 => up, 2 => not-appl; Huawei: 0 => offline, 1 => online # pon uni_idx = db.Column(db.String(64)) config_indicator = db.Column(db.String(), default='100baset-fd') link_status = db.Column(db.Enum('up', 'down'), default='up') speed = db.Column(db.String(), default='1000') box_id = db.Column(db.Integer, db.ForeignKey('box.id')) ont_id = db.Column(db.Integer, db.ForeignKey('ont.id')) cpes = db.relationship('Cpe', backref='OntPort', lazy='dynamic') # Huawei data ont_port_index = db.Column(db.Integer()) ont_port_type = db.Column(db.Enum('GE', 'ETH', 'POTS', 'VDSL', 'TDM', 'MOCA', 'CATV'), default='GE') duplex = db.Column(db.Enum('full', 'auto_full', 'auto'), default='full') link_state = db.Column(db.Enum('up', 'down'), default='down') ring_status = db.Column(db.String(), default='-') qinq_mode = db.Column(db.Enum('unconcern'), default='unconcern') priority_policy = db.Column(db.Enum('unconcern'), default='unconcern') inbound = db.Column(db.Enum('unconcern'), default='unconcern') outbound = db.Column(db.Enum('unconcern'), default='unconcern') downstream_mode = db.Column(db.Enum('operation'), default='operation') mismatch_policy = db.Column(db.Enum('discard'), default='discard') dscp_mapping_table_index = db.Column(db.Integer(), default=0) service_type = db.Column(db.String()) service_index = db.Column(db.Integer()) s_vlan = db.Column(db.Integer()) s_pri = db.Column(db.String()) c_vlan = db.Column(db.Integer()) c_pri = db.Column(db.String()) encap = db.Column(db.String()) s_pri_policy = db.Column(db.String()) igmp_mode = db.Column(db.String(), default='-') igmp_vlan = db.Column(db.String(), default='-') igmp_pri = db.Column(db.String(), default='-') max_mac_count = db.Column(db.String(), default='-') vlan_id = db.Column(db.Integer, db.ForeignKey('vlan.id'))
class LogPort(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) ports = db.Column(db.String(), default='') box_id = db.Column(db.Integer, db.ForeignKey('box.id')) card_id = db.Column(db.Integer, db.ForeignKey('card.id')) interfaces = db.relationship('Interface', backref='LogPort', lazy='dynamic') label1 = db.Column(db.String(), default='""') label2 = db.Column(db.String(), default='""') description = db.Column(db.String(), default='""') operational_state = db.Column(db.Enum('0', '1'), default='0') admin_state = db.Column(db.Enum('0', '1'), default='0') profile = db.Column(db.String(), default='default')
class Channel(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) description = db.Column(db.String()) chan_profile_name = db.Column(db.String(), default='') curr_rate_u = db.Column(db.String(), default=0) curr_rate_d = db.Column(db.String(), default=0) prev_rate_u = db.Column(db.String(), default=0) prev_rate_d = db.Column(db.String(), default=0) curr_delay_u = db.Column(db.String(), default=0) curr_delay_d = db.Column(db.String(), default=0) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) port_id = db.Column(db.Integer, db.ForeignKey('port.id')) interfaces = db.relationship('Interface', backref='Channel', lazy='dynamic')
class User(db.Model): id = db.Column(db.Integer(), primary_key=True) box_id = db.Column(db.Integer(), db.ForeignKey('box.id')) credential_details = db.relationship('Credential', backref='User', lazy='dynamic') name = db.Column(db.String(), default='user') level = db.Column(db.Enum('Super', 'Admin', 'Operator', 'User'), default='User') status = db.Column(db.Enum('online', 'offline'), default='offline') profile = db.Column(db.Enum('root', 'admin', 'operator', 'commonuser', 'enable', 'backup'), default='commonuser') append_info = db.Column(db.String(), default='-----') reenter_num = db.Column(db.Integer(), default=3) reenter_num_temp = db.Column(db.Integer(), default=3) lock_status = db.Column(db.Enum('locked', 'unlocked'), default='unlocked')
class MgmtCard(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) subrack_id = db.Column(db.Integer, db.ForeignKey('subrack.id')) mgmt_ports = db.relationship('MgmtPort', backref='MgmtCard', lazy='dynamic') description = db.Column(db.String(), default='') admin_state = db.Column(db.Enum('0', '1'), default='0') operational_state = db.Column(db.Enum('0', '1'), default='0') board_name = db.Column(db.String(), default='') supplier_build_state = db.Column(db.Enum('R1G', 'R1D', 'R2B', 'R2A', 'R1K', 'R1H', 'R2B', 'R1E', 'R3D', 'R1C', 'R1A', ''), default='') board_id = db.Column(db.Enum('345', '332', '303', '308', '377', '356', '305', '307', '330', '0'), default='0') hardware_key = db.Column(db.Integer(), default=0) software = db.Column(db.String(), default='') software_name = db.Column(db.String(), default='') software_revision = db.Column(db.String(), default='') state = db.Column(db.Enum('Ok', 'Empty'), default='Empty') serial_number = db.Column(db.String(), default='') manufacturer_name = db.Column(db.String(), default='') model_name = db.Column(db.String(), default='') short_text = db.Column(db.String(), default='') manufacturer_id = db.Column(db.String(), default='') manufacturer_part_number = db.Column(db.String(), default='') manufacturer_build_state = db.Column(db.String(), default='') customer_id = db.Column(db.String(), default='') customer_product_id = db.Column(db.String(), default='') boot_loader = db.Column(db.String(), default='') processor = db.Column(db.String(), default='') product = db.Column(db.Enum('mgmt'), nullable=False, default='mgmt')
class Card(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) subrack_id = db.Column(db.Integer, db.ForeignKey('subrack.id')) ports = db.relationship('Port', backref='Card', lazy='dynamic') ppc = db.Column(db.Enum('8', '16', '32', '48', '64'), default='32') product = db.Column(db.Enum('xdsl', 'vdsl', 'adsl', 'sdsl', 'ftth-pon', 'ftth', 'mgnt', 'analog', 'isdn'), nullable=False, default='vdsl') # Alcatel specific data description = db.Column(db.String(), default='""') position = db.Column(db.String()) entry_vlan_number = db.Column(db.Integer()) planned_type = db.Column(db.Enum('rdlt-c', 'rant-a', 'nant-a', 'nrnt-a', 'fant-f', 'relt-a', 'nelt-b', 'fglt-b', 'ngfc-f', 'empty'), default='empty') dual_tag_mode = db.Column(db.Boolean(), default=False) actual_type = db.Column(db.Enum('rdlt-c', 'rant-a', 'nant-a', 'nrnt-a', 'fant-f', 'relt-a', 'nelt-b', 'fglt-b', 'ngfc-f', 'empty'), default='empty') admin_state = db.Column(db.Enum('0', '1'), default='0') # Alcatel: 0 => disabled, 1 => unlock operational_state = db.Column(db.Enum( '0', '1'), default='0') # Alcatel: 0 => disabled, 1 => enabled err_state = db.Column(db.Enum('no-error', 'error', 'type-mismatch'), default='no-error') availability = db.Column(db.Enum('available', 'unavailable', 'not-installed'), default='available') alarm_profile = db.Column(db.Enum('none'), default='none') capab_profile = db.Column(db.Enum('32port_xDSL', 'fttu_lt', 'not_applicable'), default='32port_xDSL') manufacturer = db.Column(db.Enum('ALCL', ''), default='') mnemonic = db.Column(db.Enum('RDLT-C', 'FGLT-B', 'FANT-F', 'NGFC-F', 'RANT-A', 'NANT-A', 'NRNT-A', 'RELT-A', 'NELT-B', 'NGFC-F', ''), default='') pba_code = db.Column(db.String(), default='') fpba_code = db.Column(db.String(), default='') fpba_ics = db.Column(db.String(), default='') clei_code = db.Column(db.String(), default='') serial_no = db.Column(db.String(), default='') failed_test = db.Column(db.String(), default='00:00:00:00') lt_restart_time = db.Column(db.String(), default='1970-01-01:00:00:00') lt_restart_cause = db.Column(db.Enum('poweron', 'poweroff', 'other'), default='poweron') lt_restart_num = db.Column(db.Integer(), default=0) mgnt_entity_oamipaddr = db.Column(db.String(), default='0.0.0.0') mgnt_entity_pairnum = db.Column(db.Integer(), default=0) dual_host_ip = db.Column(db.String(), default='0.0.0.0') dual_host_loc = db.Column(db.Enum('none'), default='none') sensor_id = db.Column(db.Integer(), default=0) act_temp = db.Column(db.Integer(), default=0) tca_low = db.Column(db.Integer(), default=0) tca_high = db.Column(db.Integer(), default=0) shut_low = db.Column(db.Integer(), default=0) shut_high = db.Column(db.Integer(), default=0) restrt_cnt = db.Column(db.Integer(), default=0) vce_profile_id = db.Column(db.Integer(), default=None, nullable=True) vplt_autodiscover = db.Column(db.Enum('enabled', 'disabled'), default='disabled') vect_fallback_spectrum_profile = db.Column(db.Integer(), default=None) vect_fallback_fb_vplt_com_fail = db.Column(db.Boolean, default=False) vect_fallback_fb_cpe_cap_mism = db.Column(db.Boolean, default=False) vect_fallback_fb_conf_not_feas = db.Column(db.Boolean, default=False) # Huawei specific data board_name = db.Column(db.String(), default='H83BVCMM') board_status = db.Column(db.Enum('Normal', 'Failed', 'Active_normal', 'Standby_failed'), default='Normal') sub_type_0 = db.Column(db.String(), default='') sub_type_1 = db.Column(db.String(), default='') power_status = db.Column(db.String(), default='POWER-ON') power_off_cause = db.Column(db.String(), default='-') power_off_time = db.Column(db.String(), default='-') temperature = db.Column(db.String(), default='68C') # Keymile specific data supplier_build_state = db.Column(db.Enum('R1G', 'R1D', 'R2B', 'R2A', 'R1K', 'R1H', 'R2B', 'R1E', 'R3D', 'R1C', 'R1A', ''), default='') board_id = db.Column(db.Enum('345', '332', '303', '308', '377', '356', '305', '307', '330', '0'), default='0') hardware_key = db.Column(db.Integer(), default=0) software = db.Column(db.String(), default='') software_name = db.Column(db.String(), default='') software_revision = db.Column(db.String(), default='') state = db.Column(db.Enum('Ok', 'Empty'), default='Empty') serial_number = db.Column(db.String(), default='') manufacturer_name = db.Column(db.String(), default='') model_name = db.Column(db.String(), default='') short_text = db.Column(db.String(), default='') manufacturer_id = db.Column(db.String(), default='') manufacturer_part_number = db.Column(db.String(), default='') manufacturer_build_state = db.Column(db.String(), default='') customer_id = db.Column(db.String(), default='') customer_product_id = db.Column(db.String(), default='') boot_loader = db.Column(db.String(), default='') processor = db.Column(db.String(), default='') label1 = db.Column(db.String(), default='""') label2 = db.Column(db.String(), default='""') gateway_ipaddress = db.Column(db.String(), default='""') subnet_mask = db.Column(db.String(), default='""') default_gateway = db.Column(db.String(), default='""') # Keymile ipsx2/3 card SIP specifications gateway_name = db.Column(db.String(), default='""') home_domain = db.Column(db.String(), default='""') sip_port_number = db.Column(db.Integer(), default=0) country_code = db.Column(db.String(), default='') area_code = db.Column(db.String(), default='') retransmission_timer = db.Column(db.Integer(), default=0) max_retransmission_interval = db.Column(db.Integer(), default=0) sip_extension = db.Column(db.Boolean, default=False) asserted_id_mode = db.Column(db.Enum('Asserted', 'Preferred'), default=None) overlap_signalling = db.Column(db.Boolean, default=False) overlap_timer = db.Column(db.Integer(), default=0) uac_request_timer = db.Column(db.Boolean, default=False) uas_request_timer = db.Column(db.Boolean, default=False) session_expiration = db.Column(db.Integer(), default=0) # Keymile ipsx2/3 card Proxy specification proxy_mode = db.Column(db.Enum('PrimaryOnly', 'Revertive', 'NonRevertive', 'DnsRfc3263'), default='PrimaryOnly') proxy_address = db.Column(db.String(), default='""') proxy_port = db.Column(db.Integer(), default=5060) proxy_address_sec = db.Column(db.String(), default='""') proxy_port_sec = db.Column(db.Integer(), default=0) proxy_enable = db.Column(db.Boolean, default=True) proxy_method = db.Column(db.Enum('Options', 'Register'), default='Options') proxy_interval = db.Column(db.Integer(), default=10) # Keymile ipsx2/3 card Registrar specification registrar_adress = db.Column(db.String(), default='') registrar_port = db.Column(db.Integer(), default=5060) registration_mode = db.Column(db.Enum('NoRegistration', 'OneByOneRegistration'), default='OneByOneRegistration') registration_expiration_time = db.Column(db.Integer(), default=100) # Keymile ipsx2/3 card digimap specification #digimap_uri_schema = db.Column(db.Enum('sip', 'tel'), default='sip') #digit_map = db.Column(db.String(), default='') #digimap_domain_phone_context = db.Column(db.String(), default='') #digimap_prestrip = db.Column(db.Integer(), default=0) #digimap_prepend = db.Column(db.String(), default='') #Edgecore mac_address = db.Column(db.String(), default='A8-2B-B5-7F-E3-C0')
class Box(db.Model): id = db.Column(db.Integer(), primary_key=True) vendor = db.Column(db.String(64), nullable=False) model = db.Column(db.String(64), nullable=False) version = db.Column(db.String(64), nullable=False) software_version = db.Column(db.String(64), nullable=False) network_protocol = db.Column(db.Enum('telnet', 'ssh'), default='telnet') network_port = db.Column(db.Integer(), default=None) network_address = db.Column(db.String(), default=None) uuid = db.Column( db.String(36), nullable=False, unique=True, default=lambda: str(uuid.uuid1())) description = db.Column(db.String()) hostname = db.Column(db.String(64)) mgmt_address = db.Column(db.String(32)) default_gateway = db.Column(db.String(32), default='0.0.0.0') net_mask = db.Column(db.String(32), default='255.255.255.0') contact_person = db.Column(db.String(), default=None, nullable=True) isam_id = db.Column(db.String(), default=None, nullable=True) isam_location = db.Column(db.String(), default=None, nullable=True) login_banner = db.Column(db.String(), default="") welcome_banner = db.Column(db.String, default="") credentials = db.relationship('Credential', backref='Box', lazy='dynamic') credential_details = db.relationship('Credential', backref='credentials', lazy='dynamic') users = db.relationship('User', backref='Box', lazy='dynamic') user_details = db.relationship('User', backref='users', lazy='dynamic') subracks = db.relationship('Subrack', backref='Box', lazy='dynamic') subrack_details = db.relationship('Subrack', backref='subracks', lazy='dynamic') cards = db.relationship('Card', backref='Box', lazy='dynamic') mgmt_cards = db.relationship('MgmtCard', backref='Box', lazy='dynamic') ports = db.relationship('Port', backref='Box', lazy='dynamic') mgmt_ports = db.relationship('MgmtPort', backref='Box', lazy='dynamic') channels = db.relationship('Channel', backref='Box', lazy='dynamic') interfaces = db.relationship('Interface', backref='Box', lazy='dynamic') cpes = db.relationship('Cpe', backref='Box', lazy='dynamic') cpe_ports = db.relationship('CpePort', backref='Box', lazy='dynamic') onts = db.relationship('Ont', backref='Box', lazy='dynamic') ont_ports = db.relationship('OntPort', backref='Box', lazy='dynamic') port_profiles = db.relationship('PortProfile', backref='Box', lazy='dynamic') port_profile_details = db.relationship('PortProfile', backref='port_profiles', lazy='dynamic') vlans = db.relationship('Vlan', backref='Box', lazy='dynamic') vlan_details = db.relationship('Vlan', backref='vlans', lazy='dynamic') vlan_interfaces = db.relationship('VlanInterface', backref='Box', lazy='dynamic') routes = db.relationship('Route', backref='Box', lazy='dynamic') emus = db.relationship('Emu', backref='Box', lazy='dynamic') subscribers = db.relationship('Subscriber', backref='Box', lazy='dynamic') portgroupports = db.relationship('PortGroupPort', backref='Box', lazy='dynamic') logports = db.relationship('LogPort', backref='Box', lazy='dynamic') srvcs = db.relationship('Srvc', backref='Box', lazy='dynamic') service_vlans = db.relationship('ServiceVlan', backref='Box', lazy='dynamic') service_ports = db.relationship('ServicePort', backref='Box', lazy='dynamic') board_missing_reporting_logging = db.Column(db.Boolean(), default=False) board_instl_missing_reporting_logging = db.Column(db.Boolean(), default=False) board_init_reporting_logging = db.Column(db.Boolean(), default=False) board_hw_issue_reporting_logging = db.Column(db.Boolean(), default=False) plugin_dc_b_severity = db.Column(db.Boolean(), default=False) sntp_server_ip_address = db.Column(db.String(), default='') sntp_server_table = db.Column(db.String(), default='') timezone_offset = db.Column(db.String()) last_login = db.Column(db.String(), default='/') last_logout = db.Column(db.String(), default='/') logging_server_ip = db.Column(db.String(), default='') udp_logging_server_ip = db.Column(db.String(), default='') syslog_route = db.Column(db.String(), default='') public_host_address = db.Column(db.String(), default='') futurama_host_address = db.Column(db.String(), default='') tellme_host_address = db.Column(db.String(), default='') max_lt_link_speed = db.Column(db.String(), default='') port_num_in_proto = db.Column(db.Enum('type-based', 'legacy-num', 'position-based')) admin_slot_numbering = db.Column(db.String(), default='') primary_file_server_id = db.Column(db.String(), default='') disk_space = db.Column(db.Integer(), nullable=False, default=574423552) free_space = db.Column(db.Integer(), default=420016640) download_progress = db.Column(db.Enum('download-fail', 'download-ongoing', 'download-success'), default='download-success') download_error = db.Column(db.Enum('no-error', 'error'), default='no-error') upload_progress = db.Column(db.Enum('upload-fail', 'upload-ongoing', 'upload-success'), default='upload-success') upload_error = db.Column(db.Enum('no-error', 'error'), default='no-error') auto_activate_error = db.Column(db.Enum('no-error', 'error'), default='no-error') default_route = db.Column(db.String(), default=None) broadcast_frames = db.Column(db.Boolean(), default=False) priority_policy_port_default = db.Column(db.Boolean(), default=False) cpu_occupancy = db.Column(db.String(), default='20%') raio_anid = db.Column(db.String(), default='127.0.0.1') handshake_mode = db.Column(db.Enum('enable', 'disable'), default='disable') handshake_interval = db.Column(db.Integer(), default=None) interactive_mode = db.Column(db.Boolean(), default=True) smart_mode = db.Column(db.Boolean, default=True) pitp = db.Column(db.Enum('enable', 'disable'), default='disable') pitp_mode = db.Column(db.String(), default='') dsl_mode = db.Column(db.Enum('tr165', 'tr129'), default='tr165') currTemperature = db.Column(db.Integer(), default=15) ftp_server_ip = db.Column(db.String(), default='') ftp_login = db.Column(db.String(), default='') ftp_password = db.Column(db.String(), default='') network_element_management_vlan_id = db.Column(db.Integer(), default=None) #EdgeCore management_start_address = db.Column(db.String(), default='') management_end_address = db.Column(db.String(), default='') logging_host = db.Column(db.String(), default='') logging_port = db.Column(db.String(), default='') logging_level = db.Column(db.Integer(), default=7) loopback_detection_action = db.Column(db.String(), default='shutdown') sntp_server_ip = db.Column(db.String(), default='None') sntp_client = db.Column(db.Enum('Disabled', 'Enabled'), default='Disabled') timezone_name = db.Column(db.String(), default='None') timezone_time = db.Column(db.String(), default='None') summer_time_name = db.Column(db.String(), default='') summer_time_region = db.Column(db.String(), default='')
class Ont(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) description = db.Column(db.String()) admin_state = db.Column(db.Enum('0', '1'), default='0') # Alcatel: 0 => down, 1 => up; Huawei: 0 => offline, 1 => online operational_state = db.Column(db.Enum('0', '1'), default='0') # Alcatel: 0 => down, 1 => up; Huawei: 0 => offline, 1 => online vendor_id = db.Column(db.String(), default=None) version = db.Column(db.String(), default=None) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) port_id = db.Column(db.Integer, db.ForeignKey('port.id')) ont_ports = db.relationship('OntPort', backref='Ont', lazy='dynamic') # Alcatel data index = db.Column(db.Integer(), nullable=False, default=1) type = db.Column(db.Enum('10gbaselr', '1000basebx10u', '100basetxfd', '1000basebx10d', '100basebx10d', '1000baselx10'), default='1000baselx10') basebx10d = db.Column(db.Enum('yes', 'no'), default='no') media_available = db.Column(db.Enum('available', 'not-available'), default='not-available') jabber_state = db.Column(db.Enum('jabber', 'no-jabber'), default='no-jabber') b100basefxfd = db.Column(db.Enum('yes', 'no'), default='no') b100baselx10 = db.Column(db.Enum('yes', 'no'), default='no') b100basebx10d = db.Column(db.Enum('yes', 'no'), default='no') b100basebx10u = db.Column(db.Enum('yes', 'no'), default='no') b100basetxfd = db.Column(db.Enum('yes', 'no'), default='no') b1000basetfd = db.Column(db.Enum('yes', 'no'), default='no') b10gbasetfd = db.Column(db.Enum('yes', 'no'), default='no') b1000basesxfd = db.Column(db.Enum('yes', 'no'), default='no') b1000baselx10 = db.Column(db.Enum('yes', 'no'), default='no') b1000baselxfd = db.Column(db.Enum('yes', 'no'), default='no') b1000basebx10u = db.Column(db.Enum('yes', 'no'), default='no') b1000basebx10d = db.Column(db.Enum('yes', 'no'), default='no') b10gbaser = db.Column(db.Enum('yes', 'no'), default='no') b10gbaselr = db.Column(db.Enum('yes', 'no'), default='no') b10gbaseer = db.Column(db.Enum('yes', 'no'), default='no') b2500basex = db.Column(db.Enum('yes', 'no'), default='no') auto_neg_supported = db.Column(db.Boolean(), default=False) auto_neg_status = db.Column(db.Enum('configuring', 'disabled', 'complete'), default='disabled') cap100base_tfd = db.Column(db.Enum('yes', 'no'), default='no') cap1000base_xfd = db.Column(db.Enum('yes', 'no'), default='no') cap1000base_tfd = db.Column(db.Enum('yes', 'no'), default='no') cap10gbase_tfd = db.Column(db.Enum('yes', 'no'), default='no') act_num_data_ports = db.Column(db.Integer(), nullable=True) act_num_voice_ports = db.Column(db.Integer(), nullable=True) actual_card_type = db.Column(db.Enum('ethernet', 'pon'), default='ethernet') actual_ont_integ = db.Column(db.Enum('integrated')) actual_serial_num = db.Column(db.String(), nullable=False, default='123456789') actual_version_num = db.Column(db.String(), nullable=False, default='123456789') actual_vendorid = db.Column(db.String(), nullable=False, default='123456789') actual_cardid = db.Column(db.String(), nullable=False, default='123456789') state = db.Column(db.Enum('enabled')) provision = db.Column(db.Boolean(), default=False) sernum = db.Column(db.String(), nullable=False, default='123456789') subscriber_locid = db.Column(db.Enum('DEFAULT', '0000000000'), default='DEFAULT') loss_of_signal = db.Column(db.Enum('no'), default='no') loss_of_ack = db.Column(db.Enum('no'), default='no') loss_of_gem = db.Column(db.Enum('no'), default='no') physical_eqpt_err = db.Column(db.Enum('no'), default='no') startup_failure = db.Column(db.Enum('no'), default='no') signal_degrade = db.Column(db.Enum('no'), default='no') ont_disabled = db.Column(db.Enum('no'), default='no') msg_error_msg = db.Column(db.Enum('no'), default='no') inactive = db.Column(db.Enum('no'), default='no') loss_of_frame = db.Column(db.Enum('no'), default='no') signal_fail = db.Column(db.Enum('no'), default='no') dying_gasp = db.Column(db.Enum('no'), default='no') deactivate_fail = db.Column(db.Enum('no'), default='no') loss_of_ploam = db.Column(db.Enum('no'), default='no') drift_of_window = db.Column(db.Enum('no'), default='no') remote_defect_ind = db.Column(db.Enum('no'), default='no') loss_of_key_sync = db.Column(db.Enum('no'), default='no') rogue_ont_disabled = db.Column(db.Enum('no'), default='no') diff_reach = db.Column(db.Enum('no'), default='no') ont_olt_distance = db.Column(db.String(), default='12.4') eqpt_ver_num = db.Column(db.String(), default='3FE56389AEBA01') sw_ver_act = db.Column(db.String(), default='3FE56065AFGB89') sw_ver_psv = db.Column(db.String(), default='3FE56065AFBB48') equip_id = db.Column(db.String(), default='3FE56389AEBA01') actual_num_slots = db.Column(db.Integer(), default=1) num_tconts = db.Column(db.Integer(), default=32) num_trf_sched = db.Column(db.Integer(), default=32) num_prio_queues = db.Column(db.Integer(), default=124) auto_sw_planned_ver = db.Column(db.String(), default='3FE56065AFGB89') auto_sw_download_ver = db.Column(db.String(), default='3FE56065AFGB89') yp_serial_no = db.Column(db.String(), default='B1406AF0') oper_spec_ver = db.Column(db.Enum('unknown'), default='unknown') act_ont_type = db.Column(db.Enum('sfu'), default='sfu') act_txpower_ctrl = db.Column(db.Enum('tx-rx'), default='tx-rx') sn_bundle_status = db.Column(db.Enum('idle'), default='idle') cfgfile1_ver_act = db.Column(db.String(), default='') cfgfile1_ver_psv = db.Column(db.String(), default='') cfgfile2_ver_act = db.Column(db.String(), default='') cfgfile2_ver_psv = db.Column(db.String(), default='') rx_signal_level = db.Column(db.Float(), default=-14.788) tx_signal_level = db.Column(db.Float(), default=2.146) ont_temperature = db.Column(db.Float(), default=49.602) ont_voltage = db.Column(db.Float(), default=3.32) laser_bias_curr = db.Column(db.Float(), default=9950.0) olt_rx_sig_level = db.Column(db.Float(), default=-18.8) # Huawei data serial_number = db.Column(db.String(), default='485754433AD3209C') control_flag = db.Column(db.Enum('active'), default='active') config_state = db.Column(db.Enum('normal'), default='normal') match_state = db.Column(db.Enum('match'), default='match') protect_side = db.Column(db.Enum('no', 'yes'), default='no') dba_type = db.Column(db.String(), default='SR') ont_distance = db.Column(db.Integer(), default=2000) ont_last_distance = db.Column(db.Integer(), default=2000) ont_battery_state = db.Column(db.String(), default='not support') memory_occupation = db.Column(db.String()) cpu_occupation = db.Column(db.String()) temperature = db.Column(db.String(), default='50(C)') authentic_type = db.Column(db.String(), default='SN-auth') management_mode = db.Column(db.String(), default='OMCI') software_work_mode = db.Column(db.String(), default='normal') isolation_state = db.Column(db.String(), default='normal') ont_ip_zero_address_mask = db.Column(db.String(), default='-') last_down_cause = db.Column(db.String(), default='-') last_up_time = db.Column(db.String(), default='2020-01-01 00:00:00+01:00') last_down_time = db.Column(db.String(), default='-') last_dying_gasp = db.Column(db.String(), default='-') ont_online_duration = db.Column(db.String()) type_c_support = db.Column(db.String(), default='Not support') interoperability_mode = db.Column(db.String(), default='ITU-T') power_reduction_status = db.Column(db.String(), default='-') fec_upstream_state = db.Column(db.String(), default='use-profile-config') port_number_pots = db.Column(db.Enum('adaptive', '0'), default='adaptive') max_adaptive_num_pots = db.Column(db.String, default='32') port_number_eth = db.Column(db.Enum('adaptive', '0'), default='adaptive') max_adaptive_num_eth = db.Column(db.String(), default='8') port_number_vdsl = db.Column(db.Enum('adaptive', '0'), default='0') max_adaptive_num_vdsl = db.Column(db.String(), default='-') lineprofile_id = db.Column(db.Integer(), nullable=True) srvprofile_id = db.Column(db.Integer(), nullable=True) software_version = db.Column(db.String(), default=None)
class Model(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) vendor_id = db.Column(db.Integer, db.ForeignKey('vendor.id')) versions = db.relationship('Version', backref='Model', lazy='dynamic')
class Port(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) box_id = db.Column(db.Integer, db.ForeignKey('box.id')) card_id = db.Column(db.Integer, db.ForeignKey('card.id')) onts = db.relationship('Ont', backref='Port', lazy='dynamic') cpes = db.relationship('Cpe', backref='Port', lazy='dynamic') # Alcatel data description = db.Column(db.String(), default='') type = db.Column(db.Enum('pon', 'ethernet-line'), default='pon') shutdown = db.Column(db.Boolean(), default=False) speed = db.Column(db.Enum('10M', '1G', '10G'), default='1G') operational_state = db.Column( db.Enum('0', '1', '2'), default='0' ) # Alcatel: 0 => down, 1 => up, 2 => not-appl; Huawei: 0 => deactivated, 1 => activated, 2 => activating admin_state = db.Column( db.Enum('0', '1', '2', '3'), default='0' ) # Alcatel: 0 => down, 1 => up, 2 => not-appl; Huawei: 0 => deactivated, 1 => activated, 2 => activating; KeyMile: 0 => down, 1 => up, 2 => locked, 3 => unlocked upstream = db.Column(db.Integer(), default=0) downstream = db.Column(db.Integer(), default=0) upstream_max = db.Column(db.String(), default="100000") downstream_max = db.Column(db.String(), default="100000") cur_init_state = db.Column(db.Enum('up', 'down', 'shutdown'), default='down') auto_negotiation = db.Column(db.Boolean(), default=True) mtu = db.Column(db.Integer(), default=1500) noise_margin_up = db.Column(db.Integer(), default=0) noise_margin_down = db.Column(db.Integer(), default=0) tgt_noise_margin_up = db.Column(db.Integer(), default=0) tgt_noise_margin_down = db.Column(db.Integer(), default=0) attenuation_up = db.Column(db.Integer(), default=0) attenuation_down = db.Column(db.Integer(), default=0) attained_upstream = db.Column(db.Integer(), default=0) attained_downstream = db.Column(db.Integer(), default=0) threshold_upstream = db.Column(db.Integer(), default=0) threshold_downstream = db.Column(db.Integer(), default=0) max_delay_upstream = db.Column(db.Integer(), default=0) max_delay_downsteam = db.Column(db.Integer(), default=0) if_index = db.Column(db.Integer(), default=94502912) high_speed = db.Column(db.Integer(), default=0) connector_present = db.Column(db.Enum('not-applicable'), default='not-applicable') media = db.Column(db.FLOAT, default=0.0) largest_pkt_size = db.Column(db.Integer(), default=0) curr_bandwith = db.Column(db.Integer(), default=1244000000) phy_addr = db.Column(db.String(), default='') last_chg_opr_stat = db.Column(db.String(), default='352-02:55:19') pkts_unknown_proto = db.Column(db.Integer(), default=0) in_octets = db.Column(db.Integer(), default=0) out_octets = db.Column(db.Integer(), default=0) in_ucast_pkts = db.Column(db.Integer(), default=0) out_ucast_pkts = db.Column(db.Integer(), default=0) in_mcast_pkts = db.Column(db.Integer(), default=0) out_mcast_pkts = db.Column(db.Integer(), default=0) in_broadcast_pkts = db.Column(db.Integer(), default=0) out_broadcast_pkts = db.Column(db.Integer(), default=0) in_discard_pkts = db.Column(db.Integer(), default=0) out_discard_pkts = db.Column(db.Integer(), default=0) in_err_pkts = db.Column(db.Integer(), default=0) out_err_pkts = db.Column(db.Integer(), default=0) in_octets_hc = db.Column(db.Integer(), default=0) out_octets_hc = db.Column(db.Integer(), default=0) in_ucast_pkts_hc = db.Column(db.Integer(), default=0) out_ucast_pkts_hc = db.Column(db.Integer(), default=0) in_mcast_pkts_hc = db.Column(db.Integer(), default=0) out_mcast_pkts_hc = db.Column(db.Integer(), default=0) in_broadcast_pkts_hc = db.Column(db.Integer(), default=0) out_broadcast_pkts_hc = db.Column(db.Integer(), default=0) position = db.Column(db.String()) diag_avail_status = db.Column(db.Enum('no-error'), default='no-error') los = db.Column(db.Enum('not-available'), default='not-available') tx_fault = db.Column(db.Enum('no-tx-fault'), default='no-tx-fault') tx_power = db.Column(db.String(), default='"3.85 dBm"') rx_power = db.Column(db.Enum('not-available'), default='not-available') tx_bias_current = db.Column(db.String(), default='"16.17 mA"') supply_voltage = db.Column(db.String(), default='"3.23 VDC"') temperature = db.Column(db.String(), default='"57.39 degrees Celsius"') temperature_tca = db.Column(db.Enum('normal-value'), default='normal-value') voltage_tca = db.Column(db.Enum('normal-value'), default='normal-value') bias_current_tca = db.Column(db.Enum('normal-value'), default='normal-value') tx_power_tca = db.Column(db.Enum('normal-value'), default='normal-value') rx_power_tca = db.Column(db.Enum('normal-value'), default='normal-value') rssi_profile_id = db.Column(db.Integer, default=65535) rssi_state = db.Column(db.Enum('enable'), default='enable') inp_up = db.Column(db.Integer(), default=0) inp_dn = db.Column(db.Integer(), default=0) interl_us = db.Column(db.Integer(), default=0) interl_dn = db.Column(db.Integer(), default=0) cur_op_mode = db.Column(db.Enum('default'), default='default') rinit_1d = db.Column(db.Integer(), default=0) actual_tps_tc_mode = db.Column(db.Enum('ptm'), default='ptm') rtx_mode_up = db.Column(db.Enum('unknown'), default='unknown') rtx_mode_dn = db.Column(db.Enum('unknown'), default='unknown') total_reset_attempt = db.Column(db.Integer(), default=0) success_reset_attempt = db.Column(db.Integer(), default=0) service_profile_id = db.Column(db.Integer(), default=None, nullable=True) spectrum_profile_id = db.Column(db.Integer(), default=None, nullable=True) vect_profile_id = db.Column(db.Integer(), default=None, nullable=True) dpbo_profile_id = db.Column(db.Integer(), default=None, nullable=True) qos_profile_id = db.Column(db.Integer(), default=None, nullable=True) inventory_status = db.Column(db.Enum('cage-empty', 'no-error'), default='cage-empty') alu_part_num = db.Column(db.String(), default='not-available') tx_wavelength = db.Column(db.String(), default='not-available') fiber_type = db.Column(db.Enum('not-available', 'single-mode'), default='not-available') rssi_sfptype = db.Column(db.String(), default='not-available') mfg_name = db.Column(db.String(), default='NEOPHOTONICS') mfg_oui = db.Column(db.String(), default='000000') mfg_date = db.Column(db.String(), default='27/10/2016') egress_port = db.Column(db.Boolean(), default=False) # Huawei data ont_autofind = db.Column(db.Boolean(), default=False) loopback = db.Column(db.Enum('enable', 'disable'), default='disable') dynamic_profile = db.Column(db.Enum('Bind no dynamic-profile', ''), default='') dynamic_profile_index = db.Column(db.String(), default='-') dynamic_profile_name = db.Column(db.String(), default='-') line_template = db.Column(db.String(), default='') line_template_num = db.Column(db.String(), nullable=True, default='-') alarm_template = db.Column(db.String(), default='No.1 DEFVAL') alarm_template_num = db.Column(db.Integer(), nullable=False, default=1) line_spectrum_profile = db.Column(db.String(), default='') spectrum_profile_num = db.Column(db.String(), nullable=True, default='-') upbo_profile = db.Column(db.String(), default='') upbo_profile_num = db.Column(db.String(), nullable=True, default='-') dpbo_profile = db.Column(db.String(), default='') dpbo_profile_num = db.Column(db.String(), nullable=True, default='-') rfi_profile = db.Column(db.String(), default='') rfi_profile_num = db.Column(db.String(), nullable=True, default='-') noise_margin_profile = db.Column(db.String(), default='') noise_margin_profile_num = db.Column(db.String(), nullable=True, default='-') virtual_noise_profile = db.Column(db.String(), default='') virtual_noise_profile_num = db.Column(db.String(), nullable=True, default='-') inm_profile = db.Column(db.String(), default='') inm_profile_num = db.Column(db.String(), nullable=True, default='-') sos_profile = db.Column(db.String(), default='') sos_profile_num = db.Column(db.String(), nullable=True, default='-') hardware = db.Column(db.Enum('XTU-C', 'ATU-C'), default='XTU-C') last_up_time = db.Column(db.String(), default='2019-09-17 11:46:10+01:00') last_down_time = db.Column(db.String(), default='2019-09-17 11:45:24+01:00') show_time = db.Column(db.Integer(), nullable=False, default=0) nte_power_status = db.Column(db.Enum('on', 'off'), default='off') current_operational_mode = db.Column(db.String(), default='No Protocol Selected') total_count_of_line_training = db.Column(db.Integer(), nullable=False, default=0) result_last_initialization = db.Column( db.Enum('No failure'), default='No failure') # Find corresponding value(s) total_bytes_us = db.Column(db.Integer(), default=448203129) total_packets_us = db.Column(db.Integer(), default=6386689) total_bytes_ds = db.Column(db.Integer(), default=430667320) total_packets_ds = db.Column(db.Integer(), default=6493472) total_discarded_packets_ds = db.Column(db.Integer(), default=0) channel_packets_discarded_ds = db.Column(db.Integer(), default=0) channel_ds_data_rate_profile = db.Column(db.String(), default='') channel_ds_data_rate_profile_num = db.Column(db.String(), nullable=True, default='-') channel_us_data_rate_profile = db.Column(db.String(), default='') channel_us_data_rate_profile_num = db.Column(db.String(), nullable=True, default='-') channel_inp_delay_profile = db.Column(db.String(), default='') channel_inp_data_rate_profile_num = db.Column(db.String(), nullable=True, default='-') channel_ds_rate_adapt_ratio = db.Column(db.String(), nullable=True, default='-') channel_us_rate_adapt_ratio = db.Column(db.String(), nullable=True, default='-') standard_port_in_training = db.Column(db.String(), default='G.993.2-Annex B') current_power_management_state = db.Column(db.String(), default='Full-on state') retransmission_used_us = db.Column( db.String(), default='Unused, retransmission mode is forbidden') retransmission_used_ds = db.Column( db.String(), default='Unused, retransmission mode is forbidden') signal_attenuation_ds_1 = db.Column(db.FLOAT(), default=3.9) signal_attenuation_us_1 = db.Column(db.FLOAT(), default=5.5) line_attenuation_ds_1 = db.Column(db.FLOAT(), default=3.9) line_attenuation_us_1 = db.Column(db.FLOAT(), default=5.5) act_line_rate_ds_1 = db.Column(db.Integer(), default=35584) act_line_rate_us_1 = db.Column(db.Integer(), default=4168) line_snr_margin_ds_1 = db.Column(db.FLOAT(), default=33.0) line_snr_margin_us_1 = db.Column(db.FLOAT(), default=39.2) vdsl_2_psd_class_mask = db.Column(db.String(), default='B998M2x') act_psd_ds = db.Column(db.String(), default='-') act_psd_us = db.Column(db.String(), default='-') act_klo_co = db.Column(db.String(), default='24') act_klo_cpe = db.Column(db.String(), default='30') us_1_band_act_klo_val = db.Column(db.String(), default='24') us_2_band_act_klo_val = db.Column(db.String(), default='24') us_3_band_act_klo_val = db.Column(db.String(), default='-') us_4_band_act_klo_val = db.Column(db.String(), default='-') ds_1_band_act_klo_val = db.Column(db.String(), default='-') ds_2_band_act_klo_val = db.Column(db.String(), default='-') ds_3_band_act_klo_val = db.Column(db.String(), default='-') ds_4_band_act_klo_val = db.Column(db.String(), default='-') receive_signal_threshhold_ds = db.Column(db.Integer(), default=-30) receive_signal_threshhold_us = db.Column(db.Integer(), default=-15) total_output_power_ds = db.Column(db.FLOAT(), default=10.8) total_output_power_us = db.Column(db.FLOAT(), default=-7.5) current_vdsl_2_profile = db.Column(db.String(), default='Profile17a') coding_gain_ds = db.Column(db.String(), default='-') coding_gain_us = db.Column(db.String(), default='-') power_cut_back_ds = db.Column(db.String(), default='-') signal_attenuation_ds_2 = db.Column(db.FLOAT(), default=7.1) line_attenuation_ds_2 = db.Column(db.FLOAT(), default=7.1) line_snr_margin_ds_2 = db.Column(db.FLOAT(), default=32.6) signal_attenuation_us_2 = db.Column(db.FLOAT(), default=7.3) line_attenuation_us_2 = db.Column(db.FLOAT(), default=79) line_snr_margin_us_2 = db.Column(db.FLOAT(), default=37.9) signal_attenuation_ds_3 = db.Column(db.FLOAT(), default=11.4) line_attenuation_ds_3 = db.Column(db.FLOAT(), default=11.3) line_snr_margin_ds_3 = db.Column(db.FLOAT(), default=34.0) actual_limit_psd_mask = db.Column(db.String(), default='AnnexB998ADE17-M2x-B(B8-12)') actual_transmit_rate_adapt_ds = db.Column(db.String(), default='AdaptAtStartup') actual_transmit_rate_adapt_us = db.Column(db.String(), default='AdaptAtStartup') actual_inp_of_roc_ds = db.Column(db.String(), default='-') actual_inp_of_roc_us = db.Column(db.String(), default='-') actual_snr_margin_of_roc_ds = db.Column(db.String(), default='-') actual_snr_margin_of_roc_us = db.Column(db.String(), default='-') trellis_mode_ds = db.Column(db.Enum('Enable', 'Disable'), default='Enable') trellis_mode_us = db.Column(db.Enum('Enable', 'Disable'), default='Enable') last_down_cause = db.Column(db.String(), default='LOS') port_energy_saving_flag = db.Column(db.Enum('Yes', 'No'), default='No') xpon_mac_chipset_state = db.Column(db.String(), default='Normal') signal_detect = db.Column(db.String(), default='Normal') available_bandwidth = db.Column(db.Integer(), default=1202323) illegal_rogue_ont = db.Column(db.String(), default='Inexistent') optical_module_status = db.Column(db.Enum('Online', 'Offline'), default='Online') laser_state = db.Column(db.String(), default='Normal') tx_fault_h = db.Column(db.String(), default='Normal') temperature_h = db.Column(db.FLOAT(), default=61) temperature_h_exact = db.Column(db.FLOAT(), default=61.505050) tx_bias_current_h = db.Column(db.FLOAT(), default=28) tx_bias_current_h_exact = db.Column(db.FLOAT(), default=28.000023) supply_voltage_h = db.Column(db.FLOAT(), default=3.20) supply_voltage_h_exact = db.Column(db.FLOAT(), default=3.200002) tx_power_h = db.Column(db.FLOAT(), default=3.67) tx_power_h_exact = db.Column(db.FLOAT(), default=3.670001) rx_power_h = db.Column(db.FLOAT(), default=-12.6) rx_power_h_exact = db.Column(db.FLOAT(), default=-12.680000) vendor_name = db.Column(db.String(), default='Hisense') vendor_rev = db.Column(db.FLOAT(), default=1.0) vendor_oui = db.Column(db.String(), default='Unspecified') vendor_pn = db.Column(db.String(), default='LTE3680M-BC+') vendor_sn = db.Column(db.String(), default='M5071013838') date_code = db.Column(db.String(), default='17-01-12') vendor_specific = db.Column( db.String(), default='00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00') module_type = db.Column(db.String(), default='GPON') module_sub_type = db.Column(db.String(), default='CLASS B+') used_type = db.Column(db.String(), default='OLT') encapsulation_time = db.Column(db.String(), default='SFP') sff_8472_compliance = db.Column( db.String(), default='Includes functionality described in Rev 9.5') min_distance = db.Column(db.Integer(), default=0) max_distance = db.Column(db.Integer(), default=30) max_rate = db.Column(db.Integer(), default=2500000) rate_identifier = db.Column(db.String(), default='Unspecified(0x0)') wave_length = db.Column(db.Integer(), default=1490) fiber_type_h = db.Column(db.String(), default='Single Mode') identifier = db.Column(db.String(), default='SFP or SFP Plus') ext_identifier = db.Column( db.String(), default='GBIC/SFP function is defined by two-wire interface ID only') connector = db.Column(db.String(), default='SC') encoding = db.Column(db.String(), default='NRZ') length_9_um = db.Column(db.String(), default='40.0') length_50_um = db.Column(db.String(), default='-') length_62_5_um = db.Column(db.String(), default='-') length_copper = db.Column(db.String(), default='-') length_50_um_om_3 = db.Column(db.String(), default='-') br_max = db.Column(db.String(), default='Unspecified') br_min = db.Column(db.String(), default='Unspecified') cc_base = db.Column(db.String(), default='0x4d(Correct)') cc_exit = db.Column(db.String(), default='0xb3(Correct)') rx_power_warning_threshold = db.Column(db.String(), default='[-29.2,-8.0]') rx_power_alarm_threshold = db.Column(db.String(), default='[-30.0,-7.0]') tx_power_warning_threshold = db.Column(db.String(), default='[1.0,5.0]') tx_power_alarm_threshold = db.Column(db.String(), default='[0.6,5.6]') tx_bias_warning_threshold = db.Column(db.String(), default='[0.000,70.000]') tx_bias_alarm_threshold = db.Column(db.String(), default='[0.000,90.000]') supply_voltage_warning_threshold = db.Column(db.String(), default='[3.100,3.500]') supply_voltage_alarm_threshold = db.Column(db.String(), default='[3.000,3.600]') temperature_warning_threshold = db.Column(db.String(), default='[-8,75]') temperature_alarm_threshold = db.Column(db.String(), default='[-13,80]') optic_status = db.Column(db.Enum('normal', 'absence'), default='normal') native_vlan = db.Column(db.String(), default='-') mdi = db.Column(db.String(), default='-') speed_h = db.Column(db.Enum('100', '1000', '10000', '100000', 'auto_1000', 'auto'), default='1000') duplex = db.Column(db.Enum('full', 'auto_full', 'auto'), default='full') flow_ctrl = db.Column(db.Enum('on', 'off'), default='off') active_state = db.Column(db.Enum('active', 'deactive'), default='deactive') link = db.Column(db.Enum('offline', 'online', 'failed'), default='offline') detecting_time = db.Column(db.String(), default='-') tx_state = db.Column(db.Enum('off', 'on'), default='off') resume_detect = db.Column(db.String(), default='-') detect_interval = db.Column(db.String(), default='-') resume_duration = db.Column(db.String(), default='-') auto_sensing = db.Column(db.Enum('enable', 'disable'), default='disable') alm_prof_15_min = db.Column(db.String(), default='-') warn_prof_15_min = db.Column(db.String(), default='-') alm_prof_24_hour = db.Column(db.String(), default='-') warn_prof_24_hour = db.Column(db.String(), default='-') combo_status = db.Column(db.Enum('-', 'optic', 'electric'), default='optic') vlan_id = db.Column(db.Integer()) vectoring_group = db.Column(db.Integer(), default=None) vectoring_profile_id = db.Column(db.Integer(), default=None) template_name = db.Column(db.String(), default=None) # KeyMile channels = db.relationship('Channel', backref='Port', lazy='dynamic') interfaces = db.relationship('Interface', backref='Port', lazy='dynamic') label1 = db.Column(db.String(), default='""') label2 = db.Column(db.String(), default='""') loopbacktest_state = db.Column(db.Enum('Failed', 'Passed', 'Running', 'NoTestResult', 'Stopped', 'Interrupted'), default='NoTestResult') melttest_state = db.Column(db.Enum('Failed', 'Passed', 'Running', 'NotTested'), default='NotTested') linetest_state = db.Column(db.Enum('Failed', 'Passed', 'Running', 'NotTested'), default='NotTested') mode = db.Column(db.String(), default='') flow_control = db.Column(db.String(), default='') # profiles profile1_enable = db.Column(db.Boolean(), default=False) profile1_name = db.Column(db.String(), default='') profile1_elength = db.Column(db.Integer, default=0) profile2_enable = db.Column(db.Boolean(), default=False) profile2_name = db.Column(db.String(), default='') profile2_elength = db.Column(db.Integer, default=0) profile3_enable = db.Column(db.Boolean(), default=False) profile3_name = db.Column(db.String(), default='') profile3_elength = db.Column(db.Integer, default=0) profile4_enable = db.Column(db.Boolean(), default=False) profile4_name = db.Column(db.String(), default='') profile_mode = db.Column(db.Enum('Priority', 'ElectricalLoopLength'), default=None) #Edgecore mac_address = db.Column(db.String(), default='A8-2B-B5-7F-E3-C0')
class Vendor(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(64)) models = db.relationship('Model', backref='Vendor', lazy='dynamic')