Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyEZ table/views for fpc command returns empty #1267

Open
aparuchuri1 opened this issue Sep 25, 2023 · 0 comments
Open

PyEZ table/views for fpc command returns empty #1267

aparuchuri1 opened this issue Sep 25, 2023 · 0 comments

Comments

@aparuchuri1
Copy link

aparuchuri1 commented Sep 25, 2023

import yamlordereddictloader
from jnpr.junos.factory import loadyaml
import yaml
from pprint import pprint
from jnpr.junos import Device
import json
import yamlordereddictloader
from jnpr.junos.factory.factory_loader import FactoryLoader

yaml_data = """

---
EgressCrcErrorsTable:
  command: command | display xml
  target: fpc9
  item: showFwengHistStart/showFwengHist
  key:
    - headMsg
  view: EgressHistTableView
EgressHistTableView:
  fields:
    headmsg: headMsg
    errors: _EgressCrcErrorsView
_EgressCrcErrorsView:
  item: fehistErrors
  key:
    - histChipDpLbl
  view: EgressCrcErrorsFieldsView
EgressCrcErrorsFieldsView:
  fields:
      BT: histChipDpLbl
      PFE: histPpfeId
      DRAM: drPagCrcErrS
      Egress: egrCrcLHdErrs
"""

globals().update(FactoryLoader().load(yaml.load(yaml_data,
                                                Loader=yamlordereddictloader.Loader)))
with Device(host='xyzzy', user='xyzzy', password='xyzzy', port=22) as dev:
    stats1 = EgressCrcErrorsTable(dev).get()
    
    print("thesse are stats")
    print(stats1)
    print("pretty stats")

    pprint(json.loads(stats1.to_json()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants