1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

83 lines
2.0 KiB
Python
Raw Normal View History

"""Constant definitions used throughout the application."""
2020-04-14 10:24:20 -07:00
2020-02-03 02:35:11 -07:00
# Standard Library
from datetime import datetime
__name__ = "hyperglass"
2021-01-05 22:56:15 -07:00
__version__ = "1.0.0-beta.70"
__author__ = "Matt Love"
__copyright__ = f"Copyright {datetime.now().year} Matthew Love"
__license__ = "BSD 3-Clause Clear License"
METADATA = (__name__, __version__, __author__, __copyright__, __license__)
MIN_PYTHON_VERSION = (3, 6)
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")
SUPPORTED_STRUCTURED_OUTPUT = ("juniper",)
2020-01-21 17:32:31 -07:00
STATUS_CODE_MAP = {"warning": 400, "error": 400, "danger": 500}
DNS_OVER_HTTPS = {
"google": "https://dns.google/resolve",
"cloudflare": "https://cloudflare-dns.com/dns-query",
}
PARSED_RESPONSE_FIELDS = (
2020-05-29 17:47:53 -07:00
("Prefix", "prefix", "left"),
("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),
("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 = {
"junos": "juniper",
"ios": "cisco_ios",
2020-10-05 12:12:27 -07:00
"mikrotik": "mikrotik_routeros",
2020-10-18 12:15:13 -07:00
"tsnr": "tnsr",
2020-04-12 02:17:16 -07:00
}
DRIVER_MAP = {
"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",
"frr": "hyperglass_agent",
"bird": "hyperglass_agent",
}