Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #129 from nautobot/release-v3.0.1
Browse files Browse the repository at this point in the history
Release v3.0.1
  • Loading branch information
pke11y authored Feb 3, 2023
2 parents 86a8b67 + 29f6c58 commit 7397e7c
Show file tree
Hide file tree
Showing 7 changed files with 1,033 additions and 210 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
## v3.0.1 - 2023-02-03
## Added

- #126 - Add `diff` command to compare tables between snapshots.
- #128 - Provide a function to access the IP Fabric API client.

## v3.0.0 - 2023-01-23

## Added

- #122 - Updated to support `python-ipfabric` v6 and Nautobot 1.5.
- #123 - New command `get-loaded-snapshots` for greater snapshot details.
- #123 - Added @alhogan as a codeowner.

## Changed

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ The following commands are available:
- `/ipfabric get-snapshot`: Get snapshot as reference for commands.
- `/ipfabric device-list`: Get the device list.
- `/ipfabric interfaces [device] [metric]`: Get interface metrics for a device.
- `/ipfabric end-to-end-path [src-ip] [dst-ip] [src-port] [dst-port] [protocol]`: Execute end-to-end path simulation between source and target IP address.
- `/ipfabric pathlookup [src-ip] [dst-ip] [src-port] [dst-port] [protocol]`: Path simulation diagram lookup between source and target IP address.
- `/ipfabric pathlookup-icmp [src-ip] [dst-ip] [icmp-type]`: ICMP path simulation diagram lookup between source and target IP address.
- `/ipfabric routing [device] [protocol] [filter-opt]`: Get routing information for a device.
- `/ipfabric wireless [option] [ssid]`: Get wireless information by client or ssid.
- `/ipfabric find-host [filter-key] [filter-value]`: Get host information using the inventory host table.
- `/ipfabric table-diff [category] [table] [snapshot] [view]`: Get the diff of the category/table between the current snapshot and snapshot. Output view can be either a summary with counters or detailed with tables.

IP Fabric uses a concept of snapshots which can include different devices and data. The plugin supports querying specific snapshots via the `/ipfabric set-snapshot` command. The snapshot is set per user and cached for all future commands. If a snapshot is not set, the commands will default to `$last` unless a specific snapshot id is required.

Expand Down
2 changes: 1 addition & 1 deletion development/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NAPALM_TIMEOUT=5
NAUTOBOT_ROOT=/opt/nautobot
POSTGRES_DB=nautobot
POSTGRES_HOST=postgres
POSTGRES_USER=nautbot
POSTGRES_USER=nautobot
REDIS_HOST=redis
NAUTOBOT_REDIS_HOST=redis
NAUTOBOT_LOG_LEVEL=DEBUG
Expand Down
341 changes: 341 additions & 0 deletions nautobot_chatops_ipfabric/ipfabric_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,347 @@ class IpFabric:
# Sort
INTERFACE_SORT = {"order": "desc", "column": "intName"}

# Tables
table_choices = {
"addressing": [
"arp_table",
"ipv6_neighbor_discovery",
"mac_table",
"managed_duplicate_ip",
"managed_ip_ipv4",
"managed_ip_ipv6",
"nat_pools",
"nat_rules",
],
"cloud": ["virtual_interfaces", "virtual_machines"],
"dhcp": [
"relay_global_stats_received",
"relay_global_stats_relayed",
"relay_global_stats_sent",
"relay_global_stats_summary",
"relay_interfaces",
"relay_interfaces_stats_received",
"relay_interfaces_stats_relayed",
"relay_interfaces_stats_sent",
"server_excluded_interfaces",
"server_excluded_ranges",
"server_leases",
"server_pools",
"server_summary",
],
"fhrp": [
"balancing",
"glbp_forwarders",
"group_members",
"group_state",
"stproot_alignment",
"virtual_gateways",
],
"interfaces": [
"average_rates_data_bidirectional",
"average_rates_data_bidirectional_per_device",
"average_rates_data_inbound",
"average_rates_data_inbound_per_device",
"average_rates_data_outbound",
"average_rates_data_outbound_per_device",
"average_rates_drops_bidirectional",
"average_rates_drops_bidirectional_per_device",
"average_rates_drops_inbound",
"average_rates_drops_inbound_per_device",
"average_rates_drops_outbound",
"average_rates_drops_outbound_per_device",
"average_rates_errors_bidirectional",
"average_rates_errors_bidirectional_per_device",
"average_rates_errors_inbound",
"average_rates_errors_inbound_per_device",
"average_rates_errors_outbound",
"average_rates_errors_outbound_per_device",
"connectivity_matrix",
"connectivity_matrix_unmanaged_neighbors_detail",
"connectivity_matrix_unmanaged_neighbors_summary",
"counters_inbound",
"counters_outbound",
"current_rates_data_bidirectional",
"current_rates_data_inbound",
"current_rates_data_outbound",
"duplex",
"err_disabled",
"mtu",
"point_to_point_over_ethernet",
"point_to_point_over_ethernet_sessions",
"storm_control_all",
"storm_control_broadcast",
"storm_control_multicast",
"storm_control_unicast",
"switchport",
"transceivers",
"transceivers_errors",
"transceivers_statistics",
"transceivers_triggered_thresholds",
"tunnels_ipv4",
"tunnels_ipv6",
],
"ip_telephony": ["phones"],
"inventory": [
"devices",
"families",
"fans",
"hosts",
"interfaces",
"models",
"modules",
"os_version_consistency",
"phones",
"platforms",
"pn",
"sites",
"vendors",
],
"load_balancing": [
"virtual_servers",
"virtual_servers_f5_partitions",
"virtual_servers_pool_members",
"virtual_servers_pools",
],
"managed_networks": ["gateway_redundancy", "networks"],
"management": [
"aaa_accounting",
"aaa_authentication",
"aaa_authorization",
"aaa_lines",
"aaa_password_strength",
"aaa_servers",
"aaa_users",
"cisco_smart_licenses_authorization",
"cisco_smart_licenses_registration",
"cisco_smart_licenses_reservations",
"dns_resolver_servers",
"dns_resolver_settings",
"flow_overview",
"license_summary",
"licenses",
"licenses_detail",
"logging_local",
"logging_remote",
"logging_summary",
"netflow_collectors",
"netflow_devices",
"netflow_interfaces",
"ntp_sources",
"ntp_summary",
"port_mirroring",
"ptp_interfaces",
"ptp_local_clock",
"ptp_masters",
"saved_config_consistency",
"sflow_collectors",
"sflow_devices",
"sflow_sources",
"snmp_communities",
"snmp_summary",
"snmp_trap_hosts",
"snmp_users",
"telnet_access",
],
"mpls": [
"l2vpn_circuit_cross_connect",
"l2vpn_point_to_multipoint",
"l2vpn_point_to_point_vpws",
"l2vpn_pseudowires",
"l3vpn_pe_routers",
"l3vpn_pe_routes",
"l3vpn_pe_vrfs",
"l3vpn_vrf_targets",
"ldp_interfaces",
"ldp_neighbors",
"rsvp_forwarding",
"rsvp_interfaces",
"rsvp_neighbors",
],
"multicast": [
"igmp_groups",
"igmp_interfaces",
"igmp_snooping_global_config",
"igmp_snooping_groups",
"igmp_snooping_vlans",
"mac_table",
"mroute_counters",
"mroute_first_hop_router",
"mroute_oil_detail",
"mroute_overview",
"mroute_sources",
"mroute_table",
"pim_neighbors",
"rp_bsr",
"rp_mappings",
"rp_mappings_groups",
"rp_overview",
],
"neighbors": [
"neighbors_all",
"neighbors_endpoints",
"neighbors_unidirectional",
"neighbors_unmanaged",
],
"oam": [
"unidirectional_link_detection_interfaces",
"unidirectional_link_detection_neighbors",
],
"platforms": [
"cisco_fex_interfaces",
"cisco_fex_modules",
"cisco_vdc_devices",
"cisco_vss_chassis",
"cisco_vss_vsl",
"environment_fans",
"environment_modules",
"environment_power_supplies",
"environment_power_supplies_fans",
"juniper_cluster",
"platform_cisco_vss",
"poe_devices",
"poe_interfaces",
"poe_modules",
"stacks",
"stacks_members",
"stacks_stack_ports",
],
"port_channels": [
"inbound_balancing_table",
"member_status_table",
"mlag_cisco_vpc",
"mlag_pairs",
"mlag_peers",
"mlag_switches",
"outbound_balancing_table",
],
"qos": [
"marking",
"policing",
"policy_maps",
"priority_queuing",
"queuing",
"random_drops",
"shapping",
],
"routing": [
"bgp_address_families",
"bgp_neighbors",
"eigrp_interfaces",
"eigrp_neighbors",
"isis_interfaces",
"isis_neighbors",
"ospf_interfaces",
"ospf_neighbors",
"ospfv3_interfaces",
"ospfv3_neighbors",
"path_lookup_checks",
"rip_interfaces",
"rip_neighbors",
"route_stability",
"routes_ipv4",
"routes_ipv6",
"summary_protocols",
"summary_protocols_bgp",
"summary_protocols_eigrp",
"summary_protocols_isis",
"summary_protocols_ospf",
"summary_protocols_ospfv3",
"summary_protocols_rip",
"vrf_detail",
"vrf_interfaces",
"vrf_summary",
],
"sdn": [
"aci_dtep",
"aci_endpoints",
"aci_vlan",
"aci_vrf",
"apic_applications",
"apic_bridge_domains",
"apic_contexts",
"apic_contracts",
"apic_controllers",
"apic_endpoint_groups",
"apic_endpoint_groups_contracts",
"vxlan_interfaces",
"vxlan_peers",
"vxlan_vni",
"vxlan_vtep",
],
"sdwan": ["links", "sites"],
"security": [
"acl",
"acl_global_policies",
"acl_interface",
"dhcp_snooping",
"dhcp_snooping_bindings",
"dmvpn",
"ipsec_gateways",
"ipsec_tunnels",
"secure_ports_devices",
"secure_ports_interfaces",
"secure_ports_users",
"zone_firewall_interfaces",
"zone_firewall_policies",
],
"stp": [
"bridges",
"guards",
"inconsistencies",
"inconsistencies_details",
"inconsistencies_multiple_stp",
"inconsistencies_ports_multiple_neighbors",
"inconsistencies_ports_vlan_mismatch",
"inconsistencies_stp_cdp_ports_mismatch",
"instances",
"neighbors",
"ports",
"stability",
"vlans",
],
"vlans": [
"device_detail",
"device_summary",
"l3_gateways",
"network_summary",
"site_summary",
],
"wireless": [
"access_points",
"clients",
"controllers",
"radios_detail",
"radios_ssid_summary",
],
}

all_tables = []

for k, v in table_choices.items():
all_tables.extend(v)

skip_properties = [
"stpDomain",
"siteKey",
"rd",
"taskKey",
"source",
"target",
"neiSiteKey",
"srcSiteKey",
"dstSiteKey",
"inDropsPktsPct",
"inDropsRate",
"inImpactDrops",
"outDropsPktsPct",
"outDropsRate",
"outImpactDrops",
"outBytesRate",
"uniqId",
"license",
]

def __init__(self, base_url, token, verify=False, timeout=10):
"""Initialise the IP Fabric wrapper object to provide access to the client and diagram API from the python-ipfabric library.
Expand Down
Loading

0 comments on commit 7397e7c

Please sign in to comment.