2019-12-29 23:57:39 -07:00
|
|
|
"""Constant definitions used throughout the application."""
|
2020-04-14 10:24:20 -07:00
|
|
|
|
2020-02-03 02:35:11 -07:00
|
|
|
# Standard Library
|
2020-01-20 19:50:08 -07:00
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
__name__ = "hyperglass"
|
2021-01-28 23:04:57 -07:00
|
|
|
__version__ = "1.0.0-beta.75"
|
2020-01-20 19:50:08 -07:00
|
|
|
__author__ = "Matt Love"
|
|
|
|
__copyright__ = f"Copyright {datetime.now().year} Matthew Love"
|
|
|
|
__license__ = "BSD 3-Clause Clear License"
|
|
|
|
|
|
|
|
METADATA = (__name__, __version__, __author__, __copyright__, __license__)
|
2019-07-07 02:49:54 -07:00
|
|
|
|
2020-02-16 00:52:29 -07:00
|
|
|
MIN_PYTHON_VERSION = (3, 6)
|
2019-12-30 23:00:53 -07:00
|
|
|
|
2021-01-18 14:35:10 -07:00
|
|
|
MIN_NODE_VERSION = 14
|
|
|
|
|
2020-01-31 02:06:27 -10:00
|
|
|
TARGET_FORMAT_SPACE = ("huawei", "huawei_vrpv8")
|
2019-09-13 00:36:58 -07:00
|
|
|
|
2020-04-12 02:17:16 -07:00
|
|
|
TARGET_JUNIPER_ASPATH = ("juniper", "juniper_junos")
|
|
|
|
|
2020-05-02 23:05:17 -07:00
|
|
|
SUPPORTED_STRUCTURED_OUTPUT = ("juniper",)
|
|
|
|
|
2020-01-21 17:32:31 -07:00
|
|
|
STATUS_CODE_MAP = {"warning": 400, "error": 400, "danger": 500}
|
|
|
|
|
2020-02-01 01:13:26 -10:00
|
|
|
DNS_OVER_HTTPS = {
|
|
|
|
"google": "https://dns.google/resolve",
|
|
|
|
"cloudflare": "https://cloudflare-dns.com/dns-query",
|
|
|
|
}
|
|
|
|
|
2020-04-24 11:41:43 -07:00
|
|
|
PARSED_RESPONSE_FIELDS = (
|
2020-05-29 17:47:53 -07:00
|
|
|
("Prefix", "prefix", "left"),
|
2020-04-24 11:41:43 -07:00
|
|
|
("Active", "active", None),
|
|
|
|
("RPKI State", "rpki_state", "center"),
|
|
|
|
("AS Path", "as_path", "left"),
|
|
|
|
("Next Hop", "next_hop", "left"),
|
2020-05-02 18:58:15 -07:00
|
|
|
("Origin", "source_as", None),
|
2020-04-24 11:41:43 -07:00
|
|
|
("Weight", "weight", "center"),
|
|
|
|
("Local Preference", "local_preference", "center"),
|
|
|
|
("MED", "med", "center"),
|
|
|
|
("Communities", "communities", "center"),
|
|
|
|
("Originator", "source_rid", "right"),
|
|
|
|
("Peer", "peer_rid", "right"),
|
|
|
|
("Age", "age", "right"),
|
|
|
|
)
|
|
|
|
|
2020-01-26 02:21:12 -07:00
|
|
|
SUPPORTED_QUERY_FIELDS = ("query_location", "query_type", "query_target", "query_vrf")
|
|
|
|
SUPPORTED_QUERY_TYPES = (
|
|
|
|
"bgp_route",
|
|
|
|
"bgp_community",
|
|
|
|
"bgp_aspath",
|
|
|
|
"ping",
|
|
|
|
"traceroute",
|
|
|
|
)
|
|
|
|
|
2020-01-28 12:03:47 -07:00
|
|
|
FUNC_COLOR_MAP = {
|
|
|
|
"primary": "cyan",
|
|
|
|
"secondary": "blue",
|
|
|
|
"success": "green",
|
|
|
|
"warning": "yellow",
|
|
|
|
"error": "orange",
|
|
|
|
"danger": "red",
|
|
|
|
}
|
|
|
|
|
2020-01-31 02:06:27 -10:00
|
|
|
TRANSPORT_REST = ("frr", "bird")
|
|
|
|
|
2020-04-12 02:17:16 -07:00
|
|
|
SCRAPE_HELPERS = {
|
2021-01-16 12:47:38 -07:00
|
|
|
"mikrotik": "mikrotik_routeros",
|
|
|
|
"juniper_junos": "juniper",
|
2020-04-12 02:17:16 -07:00
|
|
|
"junos": "juniper",
|
|
|
|
"ios": "cisco_ios",
|
2020-10-18 12:15:13 -07:00
|
|
|
"tsnr": "tnsr",
|
2020-04-12 02:17:16 -07:00
|
|
|
}
|
2020-07-23 09:09:40 -07:00
|
|
|
|
|
|
|
DRIVER_MAP = {
|
2020-07-23 17:48:13 -07:00
|
|
|
"arista_eos": "scrapli",
|
|
|
|
"cisco_ios": "scrapli",
|
|
|
|
"cisco_xe": "scrapli",
|
|
|
|
"cisco_xr": "scrapli",
|
|
|
|
"cisco_nxos": "scrapli",
|
|
|
|
"juniper": "scrapli",
|
2020-10-18 12:15:13 -07:00
|
|
|
"tnsr": "scrapli",
|
2020-07-23 09:09:40 -07:00
|
|
|
"frr": "hyperglass_agent",
|
|
|
|
"bird": "hyperglass_agent",
|
|
|
|
}
|