This repository has been archived by the owner on May 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
615 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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import ip_filters | ||
import json_filters | ||
|
||
JINJA_FILTERS = [ | ||
ip_filters, | ||
json_filters, | ||
] | ||
|
||
|
||
|
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,6 @@ | ||
import json | ||
|
||
def filters(): | ||
return { | ||
"json": lambda obj: json.dumps(obj), | ||
} |
188 changes: 188 additions & 0 deletions
188
napalm_yang/mappings/eos/parsers/state/openconfig-interfaces/interfaces.yaml
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,188 @@ | ||
--- | ||
metadata: | ||
processor: JSONParser | ||
execute: | ||
- method: "device.run_commands" | ||
args: | ||
commands: ["show interfaces", "show snmp mib ifmib ifindex"] | ||
|
||
interfaces: | ||
_process: unnecessary | ||
interface: | ||
_process: | ||
- mode: dict | ||
from: "{{ bookmarks.interfaces.0.interfaces|json }}" | ||
config: | ||
_process: unnecessary | ||
hold-time: | ||
_process: not_implemented | ||
state: | ||
_process: not_implemented | ||
down: | ||
_process: not_implemented | ||
up: | ||
_process: not_implemented | ||
state: | ||
_process: unnecessary | ||
admin-status: | ||
_process: | ||
- mode: map | ||
value: "{{ bookmarks.parent.get('interfaceStatus', 'disabled') }}" | ||
map: | ||
"disabled": DOWN | ||
"errdisabled": DOWN | ||
"connected": UP | ||
"notconnect": UP | ||
counters: | ||
_process: unnecessary | ||
in-broadcast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.inBroadcastPkts }}" | ||
in-discards: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.inDiscards }}" | ||
in-errors: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.totalInErrors }}" | ||
in-multicast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.inMulticastPkts }}" | ||
_process: not_implemented | ||
in-octets: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.inOctets }}" | ||
_process: not_implemented | ||
in-unicast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.inUcastPkts }}" | ||
_process: not_implemented | ||
in-unknown-protos: | ||
_process: not_implemented | ||
last-clear: | ||
_process: not_implemented | ||
out-broadcast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.outBroadcastPkts }}" | ||
_process: not_implemented | ||
out-discards: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.outDiscards }}" | ||
_process: not_implemented | ||
out-errors: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.totalOutErrors }}" | ||
_process: not_implemented | ||
out-multicast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.outMulticastPkts }}" | ||
_process: not_implemented | ||
out-octets: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.outOctets }}" | ||
_process: not_implemented | ||
out-unicast-pkts: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.interfaceCounters.outUcastPkts }}" | ||
description: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.description }}" | ||
enabled: | ||
_process: | ||
- mode: map | ||
value: "{{ bookmarks.parent.get('interfaceStatus', 'disabled') }}" | ||
map: | ||
"disabled": false | ||
"errdisabled": true | ||
"connected": true | ||
"notconnect": true | ||
ifindex: | ||
_process: not_implemented | ||
last-change: | ||
_process: not_implemented | ||
mtu: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.mtu }}" | ||
name: | ||
_process: not_implemented | ||
oper-status: | ||
_process: | ||
- mode: map | ||
value: "{{ bookmarks.parent.get('interfaceStatus', 'disabled') }}" | ||
map: | ||
"disabled": DOWN | ||
"errdisabled": DOWN | ||
"connected": UP | ||
"notconnect": DOWN | ||
type: | ||
_process: | ||
- mode: map | ||
value: "{{ bookmarks.parent.get('hardware', 'Unspecified') }}" | ||
map: | ||
"ethernet": ethernetCsmacd | ||
"Unspecified": null | ||
subinterfaces: | ||
_process: not_implemented | ||
subinterface: | ||
_process: not_implemented | ||
state: | ||
_process: not_implemented | ||
admin-status: | ||
_process: not_implemented | ||
counters: | ||
_process: not_implemented | ||
in-broadcast-pkts: | ||
_process: not_implemented | ||
in-discards: | ||
_process: not_implemented | ||
in-errors: | ||
_process: not_implemented | ||
in-multicast-pkts: | ||
_process: not_implemented | ||
in-octets: | ||
_process: not_implemented | ||
in-unicast-pkts: | ||
_process: not_implemented | ||
in-unknown-protos: | ||
_process: not_implemented | ||
last-clear: | ||
_process: not_implemented | ||
out-broadcast-pkts: | ||
_process: not_implemented | ||
out-discards: | ||
_process: not_implemented | ||
out-errors: | ||
_process: not_implemented | ||
out-multicast-pkts: | ||
_process: not_implemented | ||
out-octets: | ||
_process: not_implemented | ||
out-unicast-pkts: | ||
_process: not_implemented | ||
description: | ||
_process: not_implemented | ||
enabled: | ||
_process: not_implemented | ||
ifindex: | ||
_process: not_implemented | ||
index: | ||
_process: not_implemented | ||
last-change: | ||
_process: not_implemented | ||
name: | ||
_process: not_implemented | ||
oper-status: | ||
_process: not_implemented |
125 changes: 125 additions & 0 deletions
125
napalm_yang/mappings/eos/parsers/state/openconfig-platform-transceiver/transceiver.yaml
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,125 @@ | ||
--- | ||
metadata: | ||
processor: JSONParser | ||
|
||
transceiver: | ||
_process: unnecessary | ||
config: | ||
_process: not_implemented | ||
enabled: | ||
_process: not_implemented | ||
ethernet-pmd-preconf: | ||
_process: not_implemented | ||
form-factor-preconf: | ||
_process: not_implemented | ||
physical-channels: | ||
_process: unnecessary | ||
channel: | ||
_process: | ||
- mode: dict | ||
from: "{{ bookmarks.parent.get('transceiver', {}).get('physical-channels', {}).get('channel', {})|json }}" | ||
config: | ||
_process: not_implemented | ||
description: | ||
_process: not_implemented | ||
index: | ||
_process: not_implemented | ||
target-output-power: | ||
_process: not_implemented | ||
tx-laser: | ||
_process: not_implemented | ||
index: | ||
_process: not_implemented | ||
state: | ||
_process: unnecessary | ||
description: | ||
_process: not_implemented | ||
index: | ||
_process: | ||
- mode: value | ||
value: "{{ parent_key }}" | ||
input-power: | ||
_process: unnecessary | ||
avg: | ||
_process: not_implemented | ||
instant: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.state.get('input-power', {}).get('instant', None) }}" | ||
when: "{{ bookmarks.parent.state.get('input-power', {}).get('instant', 'None') is not equalto 'None' }}" | ||
max: | ||
_process: not_implemented | ||
min: | ||
_process: not_implemented | ||
laser-bias-current: | ||
_process: unnecessary | ||
avg: | ||
_process: not_implemented | ||
instant: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.state.get('laser-bias-current', {}).get('instant', None) }}" | ||
when: "{{ bookmarks.parent.state.get('laser-bias-current', {}).get('instant', 'None') is not equalto 'None' }}" | ||
max: | ||
_process: not_implemented | ||
min: | ||
_process: not_implemented | ||
output-frequency: | ||
_process: not_implemented | ||
output-power: | ||
_process: unnecessary | ||
avg: | ||
_process: not_implemented | ||
instant: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.state.get('output-power', {}).get('instant', None) }}" | ||
when: "{{ bookmarks.parent.state.get('output-power', {}).get('instant', 'None') is not equalto 'None' }}" | ||
max: | ||
_process: not_implemented | ||
min: | ||
_process: not_implemented | ||
target-output-power: | ||
_process: not_implemented | ||
tx-laser: | ||
_process: not_implemented | ||
state: | ||
_process: unnecessary | ||
connector-type: | ||
_process: not_implemented | ||
date-code: | ||
_process: not_implemented | ||
enabled: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.get('transceiver', {}).get('state', {}).get('enabled', None) }}" | ||
when: "{{ bookmarks.parent.get('transceiver', {}).get('state', {}).get('enabled', 'None') is not equalto 'None' }}" | ||
ethernet-pmd: | ||
_process: | ||
- mode: value | ||
value: "{{ bookmarks.parent.get('transceiver', {}).get('state', {}).get('ethernet-pmd', None) }}" | ||
when: "{{ bookmarks.parent.get('transceiver', {}).get('state', {}).get('ethernet-pmd', 'None') is not equalto 'None' }}" | ||
ethernet-pmd-preconf: | ||
_process: not_implemented | ||
fault-condition: | ||
_process: not_implemented | ||
form-factor: | ||
_process: not_implemented | ||
form-factor-preconf: | ||
_process: not_implemented | ||
internal-temp: | ||
_process: not_implemented | ||
otn-compliance-code: | ||
_process: not_implemented | ||
present: | ||
_process: not_implemented | ||
serial-no: | ||
_process: not_implemented | ||
sonet-sdh-compliance-code: | ||
_process: not_implemented | ||
vendor: | ||
_process: not_implemented | ||
vendor-part: | ||
_process: not_implemented | ||
vendor-rev: | ||
_process: not_implemented |
Oops, something went wrong.