Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import re
- def tenant_to_group(tenant):
- """Input NetBox tenant name as string
- Returns oxidized group name as string"""
- tenant_map = {
- "APOC - CAD KMA": "CAD_KMA",
- "APOC - EVES KMA (SD-WAN)": "EVES_KMA",
- "APOC - L1 SW & Test Gen": "L1_SW_TEST_GEN",
- "APOC - LAB CORE": "LAB_CORE",
- "APOC - LAB DMZ": "LAB_DMZ",
- "APOC - LAB Infrastructure": "LAB_INFRASTRUCTURE",
- "APOC - Lab OoB MGT": "LAB_OOB_MGT",
- "APOC - L-BHN KMA": "L_BHN_KMA",
- "APOC - L-CTR KMA": "L_CTR_KMA",
- "APOC - L-TWC KMA": "L_TWC_KMA",
- "APOC - NID/CPE KMA": "NID_CPE_KMA",
- "APOC - POC KMA": "POC_KMA"
- }
- return tenant_map[tenant]
- def dev_type_to_os(dev_type):
- """Input NetBox device type as string
- Returns Oxidized OS name as string"""
- if "Juniper" in dev_type:
- os = "junos"
- elif ("Alcatel" or "Nokia") in dev_type:
- os = "sros"
- elif "Cisco" in dev_type:
- if ("ASR" or "NCS") in dev_type:
- if ("ASR-9") in dev_type:
- os = "iosxe"
- else:
- os = "iosxr"
- elif "ME" in dev_type:
- os = "iosxe"
- else:
- os = "ios"
- else:
- os = "unknown_os"
- return os
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement