Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Run Tests

on:
- workflow_dispatch
- push
- pull_request

Expand Down Expand Up @@ -32,7 +33,6 @@ jobs:
- name: Make develop
run: |
make develop
make json
git status
git diff

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ __pycache__/
# Developer files
.project
.pydevproject
.venv/

# Pycharm files
.idea
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------
* IOSXE
* Added ShowApMerakiMonitoringSummary:
* show ap meraki monitoring summary
18 changes: 17 additions & 1 deletion sdk_generator/outputs/github_parser.json
Original file line number Diff line number Diff line change
Expand Up @@ -116496,5 +116496,21 @@
}
}
}
},
"show ap meraki monitoring summary": {
"folders": {
"iosxe": {
"class": "ShowApMerakiMonitoringSummary",
"doc": "Parser for show ap meraki monitoring summary",
"module_name": "iosxe.show_ap",
"package": "genie.libs.parser",
"schema": "{\n 'meraki_monitoring': {\n 'monitoring_status': str,\n 'supported_ap_count': int,\n Optional('aps'): {\n '<class 'str'>': {\n Optional('ap_model'): str,\n Optional('radio_mac'): str,\n Optional('mac_address'): str,\n Optional('serial_number'): str,\n Optional('cloud_id'): str,\n Optional('status'): str,\n },\n },\n },\n}",
"tokens": {
"os": "iosxe"
},
"uid": "show_ap_meraki_monitoring_summary",
"url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxe/show_ap.py#L1286"
}
}
}
}
}
98 changes: 98 additions & 0 deletions src/genie/libs/parser/iosxe/show_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,104 @@ def cli(self, output=None):
return ap_cdp_neighbor_dict


# ================================================
# Schema for:
# * 'show ap meraki monitoring summary'
# ================================================
class ShowApMerakiMonitoringSummarySchema(MetaParser):
"""Schema for show ap meraki monitoring summary."""

schema = {
"meraki_monitoring": {
"monitoring_status": str,
"supported_ap_count": int,
Optional("aps"): {
str: {
Optional("ap_model"): str,
Optional("radio_mac"): str,
Optional("mac_address"): str,
Optional("serial_number"): str,
Optional("cloud_id"): str,
Optional("status"): str,
}
},
}
}


# ================================================
# Parser for:
# * 'show ap meraki monitoring summary'
# ================================================
class ShowApMerakiMonitoringSummary(ShowApMerakiMonitoringSummarySchema):
"""Parser for show ap meraki monitoring summary"""

cli_command = "show ap meraki monitoring summary"

def cli(self, output=None):
if output is None:
out = self.device.execute(self.cli_command)
else:
out = output

# initial return dictionary
result_dict = {}

# Meraki Monitoring : Disabled
monitoring_capture = re.compile(
r"^Meraki\s+Monitoring\s*:\s*(?P<status>.+)$"
)
# Number of Supported APs : 58
supported_capture = re.compile(
r"^Number\s+of\s+Supported\s+APs\s*:\s*(?P<count>\d+)"
)
# lab-ap-01 C9136I-B 0011.2233.0001 0011.2233.1001 TST00000001 Q2ZZ-0001-AAAA Registered
row_capture = re.compile(
r"^(?P<ap_name>\S+)\s+"
r"(?P<ap_model>\S+)\s+"
r"(?P<radio_mac>\S+)\s+"
r"(?P<mac_address>\S+)\s+"
r"(?P<serial_number>\S+)\s+"
r"(?P<cloud_id>\S+)\s+"
r"(?P<status>.+)"
)

for line in out.splitlines():
line = line.rstrip()
if not line:
continue

monitoring_match = monitoring_capture.match(line)
if monitoring_match:
meraki_dict = result_dict.setdefault("meraki_monitoring", {})
meraki_dict["monitoring_status"] = \
monitoring_match.group("status").strip()
continue

supported_match = supported_capture.match(line)
if supported_match:
meraki_dict = result_dict.setdefault("meraki_monitoring", {})
meraki_dict["supported_ap_count"] = \
int(supported_match.group("count"))
continue

if line.startswith("AP Name") or line.startswith("---"):
continue

row_match = row_capture.match(line)
if row_match:
groups = row_match.groupdict()
ap_name = groups.pop("ap_name")
meraki_dict = result_dict.setdefault("meraki_monitoring", {})
aps = meraki_dict.setdefault("aps", {})
aps[ap_name] = {
key: value.strip() for key, value in groups.items()
}
continue

return result_dict


# =============================
# Schema for:
# * 'show ap config general'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
expected_output = {
"meraki_monitoring": {
"monitoring_status": "Disabled",
"supported_ap_count": 58,
"aps": {
"lab-ap-01": {
"ap_model": "C9136I-B",
"radio_mac": "0011.2233.0001",
"mac_address": "0011.2233.1001",
"serial_number": "TST00000001",
"cloud_id": "Q2ZZ-0001-AAAA",
"status": "Registered"
},
"lab-ap-02": {
"ap_model": "AIR-AP1562I-B-K9",
"radio_mac": "0011.2233.0002",
"mac_address": "0011.2233.1002",
"serial_number": "TST00000002",
"cloud_id": "Q2ZZ-0002-AAAB",
"status": "Registered"
},
"lab-ap-03": {
"ap_model": "AIR-AP3802I-B-K9",
"radio_mac": "0011.2233.0003",
"mac_address": "0011.2233.1003",
"serial_number": "TST00000003",
"cloud_id": "Q2ZZ-0003-AAAC",
"status": "Registered"
},
"lab-ap-04": {
"ap_model": "AIR-AP3802I-B-K9",
"radio_mac": "0011.2233.0004",
"mac_address": "0011.2233.1004",
"serial_number": "TST00000004",
"cloud_id": "Q2ZZ-0004-AAAD",
"status": "Registered"
},
"lab-ap-05": {
"ap_model": "AIR-AP3802E-B-K9",
"radio_mac": "0011.2233.0005",
"mac_address": "0011.2233.1005",
"serial_number": "TST00000005",
"cloud_id": "Q2ZZ-0005-AAAE",
"status": "Registered"
},
"lab-ap-06": {
"ap_model": "CW9176I",
"radio_mac": "0011.2233.0006",
"mac_address": "0011.2233.1006",
"serial_number": "TST00000006",
"cloud_id": "Q5BK-0006-AAAF",
"status": "Registered"
},
"lab-ap-07": {
"ap_model": "CW9176I",
"radio_mac": "0011.2233.0007",
"mac_address": "0011.2233.1007",
"serial_number": "TST00000007",
"cloud_id": "Q5BK-0007-AAAG",
"status": "Registered"
},
"lab-ap-08": {
"ap_model": "CW9176D1",
"radio_mac": "0011.2233.0008",
"mac_address": "0011.2233.1008",
"serial_number": "TST00000008",
"cloud_id": "Q5BL-0008-AAAH",
"status": "Registered"
},
"lab-ap-09": {
"ap_model": "CW9176D1",
"radio_mac": "0011.2233.0009",
"mac_address": "0011.2233.1009",
"serial_number": "TST00000009",
"cloud_id": "Q5BC-0009-AAAJ",
"status": "Registered"
},
"lab-ap-10": {
"ap_model": "CW9176I",
"radio_mac": "0011.2233.0010",
"mac_address": "0011.2233.1010",
"serial_number": "TST00000010",
"cloud_id": "Q5BK-0010-AAAK",
"status": "Registered"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Meraki Monitoring : Disabled
Number of Supported APs : 58

AP Name AP Model Radio MAC MAC Address AP Serial Number Cloud ID Status
---------------------------------------------------------------------------------------------------------------------------------------------------
lab-ap-01 C9136I-B 0011.2233.0001 0011.2233.1001 TST00000001 Q2ZZ-0001-AAAA Registered
lab-ap-02 AIR-AP1562I-B-K9 0011.2233.0002 0011.2233.1002 TST00000002 Q2ZZ-0002-AAAB Registered
lab-ap-03 AIR-AP3802I-B-K9 0011.2233.0003 0011.2233.1003 TST00000003 Q2ZZ-0003-AAAC Registered
lab-ap-04 AIR-AP3802I-B-K9 0011.2233.0004 0011.2233.1004 TST00000004 Q2ZZ-0004-AAAD Registered
lab-ap-05 AIR-AP3802E-B-K9 0011.2233.0005 0011.2233.1005 TST00000005 Q2ZZ-0005-AAAE Registered
lab-ap-06 CW9176I 0011.2233.0006 0011.2233.1006 TST00000006 Q5BK-0006-AAAF Registered
lab-ap-07 CW9176I 0011.2233.0007 0011.2233.1007 TST00000007 Q5BK-0007-AAAG Registered
lab-ap-08 CW9176D1 0011.2233.0008 0011.2233.1008 TST00000008 Q5BL-0008-AAAH Registered
lab-ap-09 CW9176D1 0011.2233.0009 0011.2233.1009 TST00000009 Q5BC-0009-AAAJ Registered
lab-ap-10 CW9176I 0011.2233.0010 0011.2233.1010 TST00000010 Q5BK-0010-AAAK Registered