class ASPeerRecordTable(BaseTable): """ Table for AS PeerRecord lists """ empty_text = "No available peers found." pk = SelectColumn() ix = tables.Column(verbose_name="Internet Exchange", accessor="network_ixlan__name") irr_as_set = tables.Column( verbose_name="IRR AS-SET", accessor="network__irr_as_set", orderable=False ) ipv6_max_prefixes = tables.Column( verbose_name="IPv6", accessor="network__info_prefixes6" ) ipv4_max_prefixes = tables.Column( verbose_name="IPv4", accessor="network__info_prefixes4" ) ipv6_address = tables.Column( verbose_name="IPv6 Address", accessor="network_ixlan__ipaddr6" ) ipv4_address = tables.Column( verbose_name="IPv4 Address", accessor="network_ixlan__ipaddr4" ) class Meta(BaseTable.Meta): model = PeerRecord fields = ( "pk", "ix", "irr_as_set", "ipv6_max_prefixes", "ipv4_max_prefixes", "ipv6_address", "ipv4_address", )
class AutonomousSystemTable(BaseTable): """ Table for AutonomousSystem lists """ pk = SelectColumn() asn = tables.Column(verbose_name='ASN') name = tables.LinkColumn() irr_as_set = tables.Column(verbose_name='IRR AS-SET', orderable=False) ipv6_max_prefixes = tables.Column(verbose_name='IPv6 Max Prefixes') ipv4_max_prefixes = tables.Column(verbose_name='IPv4 Max Prefixes') actions = ActionsColumn( template_code= '<a href="{% url \'peering:as_edit\' asn=record.asn %}" class="btn btn-sm btn-warning"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a>' ) class Meta(BaseTable.Meta): model = AutonomousSystem fields = ( 'pk', 'asn', 'name', 'irr_as_set', 'ipv6_max_prefixes', 'ipv4_max_prefixes', 'actions', )
class DirectPeeringSessionTable(BaseTable): """ Table for DirectPeeringSession lists """ pk = SelectColumn() local_asn = tables.Column(verbose_name="Local ASN") ip_address = tables.LinkColumn(verbose_name="IP Address") relationship = tables.TemplateColumn(verbose_name="Relationship", template_code=BGP_RELATIONSHIP) enabled = tables.TemplateColumn(verbose_name="Status", template_code=BGPSESSION_STATUS) session_state = BGPSessionStateColumn(accessor="bgp_state") router = tables.RelatedLinkColumn(verbose_name="Router", accessor="router") actions = ActionsColumn(template_code=DIRECT_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = DirectPeeringSession fields = ( "pk", "local_asn", "ip_address", "relationship", "enabled", "session_state", "router", "actions", )
class EmailTable(BaseTable): pk = SelectColumn() name = tables.Column(linkify=True) jinja2_trim = BooleanColumn( verbose_name="Trim", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) jinja2_lstrip = BooleanColumn( verbose_name="Lstrip", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) tags = TagColumn(url_name="peering:configuration_list") buttons = ButtonsColumn(Email) class Meta(BaseTable.Meta): model = Email fields = ( "pk", "name", "subject", "jinja2_trim", "jinja2_lstrip", "updated", "tags", "buttons", ) default_columns = ("pk", "name", "updated", "buttons")
class InternetExchangeTable(BaseTable): """ Table for InternetExchange lists """ pk = SelectColumn() name = tables.Column(linkify=True) ipv6_address = tables.Column(verbose_name="IPv6 Address") ipv4_address = tables.Column(verbose_name="IPv4 Address") configuration_template = tables.Column(verbose_name="Template", accessor="configuration_template", linkify=True) router = tables.Column(verbose_name="Router", accessor="router", linkify=True) actions = ActionsColumn(template_code=INTERNET_EXCHANGE_ACTIONS) class Meta(BaseTable.Meta): model = InternetExchange fields = ( "pk", "name", "ipv6_address", "ipv4_address", "configuration_template", "router", "actions", )
class ContactTable(BaseTable): pk = SelectColumn() name = tables.Column(linkify=True) phone = tables.Column(linkify=linkify_phone) assignment_count = tables.Column(verbose_name="Assignments") tags = TagColumn(url_name="messaging:contact_list") actions = ButtonsColumn(Contact, buttons=("edit", "delete")) class Meta(BaseTable.Meta): model = Contact fields = ( "pk", "name", "title", "phone", "email", "address", "comments", "assignment_count", "tags", ) default_columns = ( "pk", "name", "assignment_count", "title", "phone", "email", "actions", )
class RouterTable(BaseTable): """ Table for Router lists """ pk = SelectColumn() name = tables.Column(linkify=True) encrypt_passwords = tables.TemplateColumn( verbose_name="Encrypt Password", template_code=ROUTER_ENCRYPT_PASSWORD, attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) configuration_template = tables.Column(linkify=True, verbose_name="Configuration") actions = ActionsColumn(template_code=ROUTER_ACTIONS) class Meta(BaseTable.Meta): model = Router fields = ( "pk", "name", "hostname", "platform", "encrypt_passwords", "configuration_template", "actions", )
class ConnectionTable(BaseTable): pk = SelectColumn() ipv6_address = tables.Column(linkify=True, verbose_name="IPv6") ipv4_address = tables.Column(linkify=True, verbose_name="IPv4") internet_exchange_point = tables.LinkColumn() router = tables.LinkColumn() buttons = ButtonsColumn(Connection) class Meta(BaseTable.Meta): model = Connection fields = ( "pk", "state", "vlan", "ipv6_address", "ipv4_address", "internet_exchange_point", "router", "interface", "buttons", ) default_columns = ( "pk", "state", "vlan", "ipv6_address", "ipv4_address", "router", "buttons", ) empty_text = "None"
class PeeringSessionTable(BaseTable): """ Table for PeeringSession lists """ pk = SelectColumn() asn = tables.Column(verbose_name='ASN', accessor='autonomous_system.asn') as_name = tables.RelatedLinkColumn( verbose_name='AS Name', accessor='autonomous_system', text=lambda record: record.autonomous_system.name) ix_name = tables.RelatedLinkColumn(verbose_name='IX Name', accessor='internet_exchange') ip_address = tables.Column(verbose_name='IP Address') enabled = tables.TemplateColumn(verbose_name='Status', template_code=BGPSESSION_STATUS) actions = ActionsColumn( template_code= '<div class="float-right"><a href="{% url \'peering:peering_session_details\' pk=record.pk %}" class="btn btn-sm btn-info"><i class="fas fa-info-circle" aria-hidden="true"></i> Details</a> <a href="{% url \'peering:peering_session_edit\' pk=record.pk %}" class="btn btn-sm btn-warning"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a></div>' ) class Meta(BaseTable.Meta): model = PeeringSession fields = ( 'pk', 'asn', 'as_name', 'ix_name', 'ip_address', 'enabled', 'actions', )
class PeerRecordTable(BaseTable): """ Table for PeerRecord lists """ empty_text = "No available peers found." pk = SelectColumn() asn = tables.Column(verbose_name="ASN", accessor="network.asn") name = tables.Column(verbose_name="AS Name", accessor="network.name") irr_as_set = tables.Column(verbose_name="IRR AS-SET", accessor="network.irr_as_set", orderable=False) ipv6_max_prefixes = tables.Column(verbose_name="IPv6", accessor="network.info_prefixes6") ipv4_max_prefixes = tables.Column(verbose_name="IPv4", accessor="network.info_prefixes4") ipv6_address = tables.Column(verbose_name="IPv6 Address", accessor="network_ixlan.ipaddr6") ipv4_address = tables.Column(verbose_name="IPv4 Address", accessor="network_ixlan.ipaddr4") class Meta(BaseTable.Meta): model = PeerRecord fields = ( "pk", "asn", "name", "irr_as_set", "ipv6_max_prefixes", "ipv4_max_prefixes", "ipv6_address", "ipv4_address", )
class PeeringSessionTableForAS(BaseTable): """ Table for PeeringSession lists """ pk = SelectColumn() ip_address = tables.Column(verbose_name='IP Address') ix = tables.RelatedLinkColumn(verbose_name='Internet Exchange', accessor='internet_exchange') enabled = tables.TemplateColumn(verbose_name='Status', template_code=BGPSESSION_STATUS) session_state = BGPSessionStateColumn(accessor='bgp_state') actions = ActionsColumn( template_code= '<div class="float-right"><a href="{% url \'peering:peering_session_details\' pk=record.pk %}" class="btn btn-sm btn-info"><i class="fas fa-info-circle" aria-hidden="true"></i> Details</a> <a href="{% url \'peering:peering_session_edit\' pk=record.pk %}" class="btn btn-sm btn-warning"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a></div>' ) class Meta(BaseTable.Meta): model = PeeringSession fields = ( 'pk', 'ip_address', 'ix', 'enabled', 'session_state', 'actions', )
class BGPGroupTable(BaseTable): """ Table for BGPGroup lists """ pk = SelectColumn() name = tables.Column(linkify=True) check_bgp_session_states = tables.TemplateColumn( verbose_name="Poll Session States", template_code=BGP_GROUP_POLL_SESSION_STATES, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) directpeeringsession_count = tables.Column( verbose_name="Direct Peering Sessions", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) actions = ActionsColumn(template_code=BGP_GROUP_ACTIONS) class Meta(BaseTable.Meta): model = BGPGroup fields = ( "pk", "name", "check_bgp_session_states", "directpeeringsession_count", "actions", )
class AutonomousSystemTable(BaseTable): """ Table for AutonomousSystem lists """ pk = SelectColumn() asn = tables.Column(verbose_name="ASN") name = tables.Column(linkify=True) irr_as_set = tables.Column(verbose_name="IRR AS-SET", orderable=False) ipv6_max_prefixes = tables.Column(verbose_name="IPv6 Max Prefixes") ipv4_max_prefixes = tables.Column(verbose_name="IPv4 Max Prefixes") has_potential_ix_peering_sessions = tables.TemplateColumn( verbose_name="", orderable=False, template_code=AUTONOMOUS_SYSTEM_HAS_POTENTIAL_IX_PEERING_SESSIONS, ) actions = ActionsColumn(template_code=AUTONOMOUS_SYSTEM_ACTIONS) class Meta(BaseTable.Meta): model = AutonomousSystem fields = ( "pk", "asn", "name", "irr_as_set", "ipv6_max_prefixes", "ipv4_max_prefixes", "actions", )
class InternetExchangeTable(BaseTable): """ Table for InternetExchange lists """ pk = SelectColumn() name = tables.LinkColumn() ipv6_address = tables.Column(verbose_name='IPv6 Address') ipv4_address = tables.Column(verbose_name='IPv4 Address') configuration_template = tables.RelatedLinkColumn( verbose_name='Template', accessor='configuration_template') router = tables.RelatedLinkColumn(verbose_name='Router', accessor='router') actions = ActionsColumn( template_code= '<a href="{% url \'peering:ix_edit\' slug=record.slug %}" class="btn btn-sm btn-warning"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a>' ) class Meta(BaseTable.Meta): model = InternetExchange fields = ( 'pk', 'name', 'ipv6_address', 'ipv4_address', 'configuration_template', 'router', 'actions', )
class AutonomousSystemTable(BaseTable): """ Table for AutonomousSystem lists """ pk = SelectColumn() asn = tables.Column(verbose_name="ASN") name = tables.LinkColumn() irr_as_set = tables.Column(verbose_name="IRR AS-SET", orderable=False) ipv6_max_prefixes = tables.Column(verbose_name="IPv6 Max Prefixes") ipv4_max_prefixes = tables.Column(verbose_name="IPv4 Max Prefixes") actions = ActionsColumn( template_code= '<a href="{% url \'peering:autonomous_system_edit\' asn=record.asn %}" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i> Edit</a>' ) class Meta(BaseTable.Meta): model = AutonomousSystem fields = ( "pk", "asn", "name", "irr_as_set", "ipv6_max_prefixes", "ipv4_max_prefixes", "actions", )
class DirectPeeringSessionTable(BaseTable): """ Table for DirectPeeringSession lists """ pk = SelectColumn() local_asn = tables.Column(verbose_name="Local ASN") autonomous_system = tables.Column(verbose_name="AS", linkify=True) ip_address = tables.Column(verbose_name="IP Address", linkify=True) relationship = tables.TemplateColumn( verbose_name="Relationship", template_code=BGP_RELATIONSHIP ) enabled = tables.TemplateColumn( verbose_name="Status", template_code=BGPSESSION_STATUS, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) session_state = BGPSessionStateColumn(accessor="bgp_state") router = tables.Column(verbose_name="Router", accessor="router", linkify=True) actions = ActionsColumn(template_code=DIRECT_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = DirectPeeringSession fields = ( "pk", "local_asn", "autonomous_system", "ip_address", "relationship", "enabled", "session_state", "router", "actions", )
class InternetExchangePeeringSessionTableForAS(BaseTable): """ Table for InternetExchangePeeringSession lists """ pk = SelectColumn() internet_exchange = tables.RelatedLinkColumn( verbose_name="Internet Exchange", accessor="internet_exchange") ip_address = tables.LinkColumn(verbose_name="IP Address") enabled = tables.TemplateColumn(verbose_name="Status", template_code=BGPSESSION_STATUS) session_state = BGPSessionStateColumn(accessor="bgp_state") actions = ActionsColumn( template_code= '<div class="float-right"><a href="{% url \'peering:internet_exchange_peering_session_edit\' pk=record.pk %}" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i> Edit</a></div>' ) class Meta(BaseTable.Meta): model = InternetExchangePeeringSession fields = ( "pk", "internet_exchange", "ip_address", "enabled", "session_state", "actions", )
class InternetExchangePeeringSessionTable(BaseTable): """ Table for InternetExchangePeeringSession lists """ pk = SelectColumn() asn = tables.Column(verbose_name="ASN", accessor="autonomous_system.asn") autonomous_system = tables.RelatedLinkColumn( verbose_name="AS Name", accessor="autonomous_system", text=lambda record: record.autonomous_system.name, ) internet_exchange = tables.RelatedLinkColumn(verbose_name="IX Name", accessor="internet_exchange") ip_address = tables.LinkColumn(verbose_name="IP Address") enabled = tables.TemplateColumn(verbose_name="Status", template_code=BGPSESSION_STATUS) actions = ActionsColumn( template_code= '<div class="float-right"><a href="{% url \'peering:internet_exchange_peering_session_edit\' pk=record.pk %}" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i> Edit</a></div>' ) class Meta(BaseTable.Meta): model = InternetExchangePeeringSession fields = ( "pk", "asn", "autonomous_system", "internet_exchange", "ip_address", "enabled", "actions", )
class InternetExchangeTable(BaseTable): """ Table for InternetExchange lists """ pk = SelectColumn() name = tables.LinkColumn() ipv6_address = tables.Column(verbose_name="IPv6 Address") ipv4_address = tables.Column(verbose_name="IPv4 Address") configuration_template = tables.RelatedLinkColumn( verbose_name="Template", accessor="configuration_template") router = tables.RelatedLinkColumn(verbose_name="Router", accessor="router") actions = ActionsColumn( template_code= '<a href="{% url \'peering:internet_exchange_edit\' slug=record.slug %}" class="btn btn-sm btn-warning"><i class="fas fa-edit"></i> Edit</a>' ) class Meta(BaseTable.Meta): model = InternetExchange fields = ( "pk", "name", "ipv6_address", "ipv4_address", "configuration_template", "router", "actions", )
class PeerRecordTable(BaseTable): """ Table for PeerRecord lists """ empty_text = 'No available peers found.' pk = SelectColumn() asn = tables.Column(verbose_name='ASN', accessor='network.asn') name = tables.Column(verbose_name='AS Name', accessor='network.name') irr_as_set = tables.Column(verbose_name='IRR AS-SET', accessor='network.irr_as_set', orderable=False) ipv6_max_prefixes = tables.Column(verbose_name='IPv6', accessor='network.info_prefixes6') ipv4_max_prefixes = tables.Column(verbose_name='IPv4', accessor='network.info_prefixes4') ipv6_address = tables.Column(verbose_name='IPv6 Address', accessor='network_ixlan.ipaddr6') ipv4_address = tables.Column(verbose_name='IPv4 Address', accessor='network_ixlan.ipaddr4') class Meta(BaseTable.Meta): model = PeerRecord fields = ( 'pk', 'asn', 'name', 'irr_as_set', 'ipv6_max_prefixes', 'ipv4_max_prefixes', 'ipv6_address', 'ipv4_address', )
class ContactRoleTable(BaseTable): pk = SelectColumn() name = tables.Column(linkify=True) actions = ButtonsColumn(ContactRole, buttons=("edit", "delete")) class Meta(BaseTable.Meta): model = ContactRole fields = ("pk", "name", "slug", "description", "actions") default_columns = ("pk", "name", "description", "actions")
class DirectPeeringSessionTable(BaseTable): """ Table for DirectPeeringSession lists """ pk = SelectColumn() local_autonomous_system = tables.Column(verbose_name="Local AS", linkify=True) autonomous_system = tables.Column(verbose_name="AS", linkify=True) ip_address = tables.Column(verbose_name="IP Address", linkify=True) bgp_group = tables.Column( verbose_name="BGP Group", accessor="bgp_group", linkify=True ) relationship = tables.TemplateColumn( verbose_name="Relationship", template_code=BGP_RELATIONSHIP ) enabled = BooleanColumn( verbose_name="Status", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies") export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies") state = BGPSessionStateColumn(accessor="bgp_state") router = tables.Column(verbose_name="Router", accessor="router", linkify=True) tags = TagColumn(url_name="peering:directpeeringsession_list") actions = ActionsColumn(template_code=DIRECT_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = DirectPeeringSession fields = ( "pk", "local_autonomous_system", "autonomous_system", "ip_address", "bgp_group", "relationship", "enabled", "import_routing_policies", "export_routing_policies", "state", "last_established_state", "received_prefix_count", "advertised_prefix_count", "router", "tags", "actions", ) default_columns = ( "pk", "local_autonomous_system", "autonomous_system", "ip_address", "bgp_group", "relationship", "enabled", "router", "actions", )
class InternetExchangeTable(BaseTable): pk = SelectColumn() local_autonomous_system = tables.Column(verbose_name="Local AS", linkify=True) name = tables.Column(linkify=True) check_bgp_session_states = BooleanColumn( verbose_name="Check Sessions", attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) bgp_session_states_update = tables.Column( verbose_name="Last Sessions Check") import_routing_policies = RoutingPolicyColumn( verbose_name="Import Policies") export_routing_policies = RoutingPolicyColumn( verbose_name="Export Policies") internetexchangepeeringsession_count = tables.Column( verbose_name="Sessions", attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) tags = TagColumn(url_name="peering:internetexchange_list") buttons = ButtonsColumn(InternetExchange, pk_field="slug") class Meta(BaseTable.Meta): model = InternetExchange fields = ( "pk", "local_autonomous_system", "name", "slug", "import_routing_policies", "export_routing_policies", "check_bgp_session_states", "bgp_session_states_update", "internetexchangepeeringsession_count", "tags", "buttons", ) default_columns = ( "pk", "name", "internetexchangepeeringsession_count", "buttons", )
class BGPGroupTable(BaseTable): """ Table for BGPGroup lists """ pk = SelectColumn() name = tables.Column(linkify=True) check_bgp_session_states = BooleanColumn( verbose_name="Poll Session States", attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) import_routing_policies = RoutingPolicyColumn( verbose_name="Import Policies") export_routing_policies = RoutingPolicyColumn( verbose_name="Export Policies") directpeeringsession_count = tables.Column( verbose_name="Direct Sessions", attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) tags = TagColumn(url_name="peering:bgpgroup_list") buttons = ButtonsColumn(BGPGroup, pk_field="slug") class Meta(BaseTable.Meta): model = BGPGroup fields = ( "pk", "name", "slug", "check_bgp_session_states", "import_routing_policies", "export_routing_policies", "directpeeringsession_count", "tags", "buttons", ) default_columns = ( "pk", "name", "check_bgp_session_states", "directpeeringsession_count", "buttons", )
class InternetExchangePeeringSessionTable(BaseTable): """ Table for InternetExchangePeeringSession lists """ pk = SelectColumn() autonomous_system = tables.Column( verbose_name="AS", accessor="autonomous_system", linkify=True ) internet_exchange = tables.Column( verbose_name="IX", accessor="internet_exchange", linkify=True ) ip_address = tables.Column(verbose_name="IP Address", linkify=True) is_direct_peer = tables.TemplateColumn( verbose_name="Route Server", template_code=INTERNET_EXCHANGE_PEERING_SESSION_IS_DIRECT_PEER, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) is_route_server = tables.TemplateColumn( verbose_name="Route Server", template_code=INTERNET_EXCHANGE_PEERING_SESSION_IS_ROUTE_SERVER, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) is_route_monitor = tables.TemplateColumn( verbose_name="Route Monitor", template_code=INTERNET_EXCHANGE_PEERING_SESSION_IS_ROUTE_MONITOR, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) is_route_server_peer = tables.TemplateColumn( verbose_name="Peer of Route Server", template_code=INTERNET_EXCHANGE_PEERING_SESSION_IS_ROUTE_SERVER_PEER, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) enabled = tables.TemplateColumn( verbose_name="Enabled", template_code=BGPSESSION_STATUS, attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) session_state = BGPSessionStateColumn(accessor="bgp_state") actions = ActionsColumn(template_code=INTERNET_EXCHANGE_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = InternetExchangePeeringSession fields = ( "pk", "autonomous_system", "internet_exchange", "ip_address", "is_direct_peer", "is_route_server", "is_route_monitor", "is_route_server_peer", "enabled", "session_state", "actions", )
class InternetExchangePeeringSessionTable(BaseTable): """ Table for InternetExchangePeeringSession lists """ pk = SelectColumn() asn = tables.Column(verbose_name="ASN", accessor="autonomous_system.asn") autonomous_system = tables.RelatedLinkColumn( verbose_name="AS Name", accessor="autonomous_system", text=lambda record: record.autonomous_system.name, ) internet_exchange = tables.RelatedLinkColumn(verbose_name="IX Name", accessor="internet_exchange") ip_address = tables.LinkColumn(verbose_name="IP Address") is_route_server = tables.TemplateColumn( verbose_name="Route Server", template_code=INTERNET_EXCHANGE_PEERING_SESSION_IS_ROUTE_SERVER, attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) enabled = tables.TemplateColumn( verbose_name="Enabled", template_code=BGPSESSION_STATUS, attrs={ "td": { "class": "text-center" }, "th": { "class": "text-center" } }, ) session_state = BGPSessionStateColumn(accessor="bgp_state") actions = ActionsColumn( template_code=INTERNET_EXCHANGE_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = InternetExchangePeeringSession fields = ( "pk", "asn", "autonomous_system", "internet_exchange", "ip_address", "is_route_server", "enabled", "session_state", "actions", )
class RelationshipTable(BaseTable): pk = SelectColumn() name = tables.LinkColumn() color = ColourColumn() buttons = ButtonsColumn(Relationship, buttons=("edit", "delete")) class Meta(BaseTable.Meta): model = Relationship fields = ("pk", "name", "slug", "description", "color", "buttons") default_columns = ("pk", "name", "color", "buttons")
class EmailTable(BaseTable): pk = SelectColumn() name = tables.Column(linkify=True) tags = TagColumn(url_name="peering:configuration_list") buttons = ButtonsColumn(Email) class Meta(BaseTable.Meta): model = Email fields = ("pk", "name", "subject", "updated", "tags", "buttons") default_columns = ("pk", "name", "updated", "buttons")
class InternetExchangePeeringSessionTable(BaseTable): """ Table for InternetExchangePeeringSession lists """ pk = SelectColumn() autonomous_system = tables.Column( verbose_name="AS", accessor="autonomous_system", linkify=True ) internet_exchange = tables.Column( verbose_name="IX", accessor="internet_exchange", linkify=True ) ip_address = tables.Column(verbose_name="IP Address", linkify=True) is_route_server = BooleanColumn( verbose_name="Route Server", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) enabled = BooleanColumn( verbose_name="Enabled", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies") export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies") state = BGPSessionStateColumn(accessor="bgp_state") tags = TagColumn(url_name="peering:internetexchangepeeringsession_list") actions = ActionsColumn(template_code=INTERNET_EXCHANGE_PEERING_SESSION_ACTIONS) class Meta(BaseTable.Meta): model = InternetExchangePeeringSession fields = ( "pk", "autonomous_system", "internet_exchange", "ip_address", "is_route_server", "enabled", "import_routing_policies", "export_routing_policies", "state", "last_established_state", "received_prefix_count", "advertised_prefix_count", "tags", "actions", ) default_columns = ( "pk", "autonomous_system", "internet_exchange", "ip_address", "is_route_server", "enabled", "enabled", "actions", )
class AutonomousSystemTable(BaseTable): """ Table for AutonomousSystem lists """ pk = SelectColumn() asn = tables.Column(verbose_name="ASN") name = tables.Column(linkify=True) irr_as_set = tables.Column(verbose_name="IRR AS-SET", orderable=False) ipv6_max_prefixes = tables.Column(verbose_name="IPv6 Max Prefixes") ipv4_max_prefixes = tables.Column(verbose_name="IPv4 Max Prefixes") import_routing_policies = RoutingPolicyColumn(verbose_name="Import Policies") export_routing_policies = RoutingPolicyColumn(verbose_name="Export Policies") directpeeringsession_count = tables.Column( verbose_name="Direct Sessions", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) internetexchangepeeringsession_count = tables.Column( verbose_name="IX Sessions", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) affiliated = BooleanColumn( verbose_name="Affiliated", attrs={"td": {"class": "text-center"}, "th": {"class": "text-center"}}, ) tags = TagColumn(url_name="peering:autonomoussystem_list") actions = ActionsColumn(template_code=AUTONOMOUS_SYSTEM_ACTIONS) class Meta(BaseTable.Meta): model = AutonomousSystem fields = ( "pk", "asn", "name", "irr_as_set", "ipv6_max_prefixes", "ipv4_max_prefixes", "import_routing_policies", "export_routing_policies", "directpeeringsession_count", "internetexchangepeeringsession_count", "affiliated", "tags", "actions", ) default_columns = ( "pk", "asn", "name", "irr_as_set", "directpeeringsession_count", "internetexchangepeeringsession_count", "actions", )