-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: Transceiver Serial Number list based on regex match
Change-Id: I0b6479d1cd7109ea4de5679238387806dd69f4bb
- Loading branch information
1 parent
caf5d83
commit df30274
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let data = `*:/Sysdb/hardware/archer/xcvr/status/all/*` | ||
let xcvrStatus = data | map(_value | mapne(_value, _value | field("goVendorInfo") | field("vendorSn"))) | ||
let xcvrStatus = xcvrStatus | map(_value | mapne(_value[0], _value)) | ||
|
||
xcvrStatus | map(_value | where(reMatch(_value, _regexInput))) | where(length(_value) > 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"dashboards": [ | ||
{ | ||
"key": "93b5abba-7807-453a-be77-56a1fde055fd", | ||
"createdAt": [ | ||
977361740, | ||
1579 | ||
], | ||
"createdBy": "cvpadmin", | ||
"metaData": { | ||
"schemaVersion": "3", | ||
"legacyKey": "", | ||
"legacyVersion": "", | ||
"fromPackage": "" | ||
}, | ||
"name": "Filtered Transcevier Data", | ||
"description": "", | ||
"widgets": [ | ||
{ | ||
"id": "0c08fed5-cd5a-44be-b083-ab950e8c93e8", | ||
"name": "", | ||
"position": { | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"dimensions": { | ||
"width": 10, | ||
"height": 14 | ||
}, | ||
"type": "aql-query-widget", | ||
"inputs": { | ||
"expression": "let data = `*:/Sysdb/hardware/archer/xcvr/status/all/*`\nlet xcvrStatus = data | map(_value | mapne(_value, _value | field(\"goVendorInfo\") | field(\"vendorSn\")))\nlet xcvrStatus = xcvrStatus | map(_value | mapne(_value[0], _value))\n\nlet filteredXcvrStat = newDict()\n\nfor deviceKey, deviceValue in xcvrStatus {\n filteredXcvrStat[deviceKey] = newDict()\n for interfaceKey, interfaceValue in deviceValue {\n if reMatch(interfaceValue, _regexInput){\n filteredXcvrStat[deviceKey][interfaceKey] = interfaceValue\n\n }\n }\n if length(filteredXcvrStat[deviceKey]) == 0 {\n dictRemove(filteredXcvrStat, deviceKey)\n }\n}\n\nfilteredXcvrStat\n", | ||
"graphConfig": { | ||
"columns": { | ||
"key": { | ||
"mapToHostname": true | ||
} | ||
} | ||
}, | ||
"visualization": "table" | ||
}, | ||
"location": "main", | ||
"parent": "" | ||
}, | ||
{ | ||
"id": "85920a17-dd18-47b0-a315-ba350f6f0a6d", | ||
"name": "", | ||
"position": { | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"dimensions": { | ||
"width": 6, | ||
"height": 2 | ||
}, | ||
"type": "variable-widget", | ||
"inputs": { | ||
"defaultValue": "", | ||
"inputName": "regexInput", | ||
"inputType": "FreeForm", | ||
"variableType": "String" | ||
}, | ||
"location": "inputs", | ||
"parent": "" | ||
} | ||
], | ||
"lastUpdated": 1696513262320, | ||
"lastUpdatedBy": "cvpadmin" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
List the serial numbers for all transceivers | ||
-------------------------------------------- | ||
|
||
.. literalinclude:: xcvr_sn_list_filtered.aql | ||
:language: aql | ||
|
||
.. image:: xcvr_sn_list_filtered.png | ||
:width: 600 | ||
:alt: List the serial numbers for all transceivers that match the regex | ||
|
||
:download:`Download the Dashboard JSON here <xcvr_sn_list_filtered.json>` |