Skip to content

added base code for gnmi api client - #431

Open
Meghna Mishra (meghna-mishra) wants to merge 1 commit into
Azure:masterfrom
meghna-mishra:gnmi_api_client
Open

added base code for gnmi api client#431
Meghna Mishra (meghna-mishra) wants to merge 1 commit into
Azure:masterfrom
meghna-mishra:gnmi_api_client

Conversation

@meghna-mishra

Copy link
Copy Markdown

What I did

Added base code for GnmiApiClient

  1. Accepts SHOW CLI command as string (base implemented, short options not implemented yet).
  2. Connects to telemetry and gets JSON result from SHOW gNMI (not implemented yet, returns default output).
  3. Converts JSON result to CLI tabular output (not implemented yet, returns default output, need to port implemented code from a different source later).

How I did it

Modified the following file.
setup.py: added 'gnmi_api_client' to the packages list

Added the following files.
client.py: GnmiApiClient orchestrator + CLI main() (test-mode only)
input_formatter.py: ShowCliToGnmiPathConverter — CLI tokens → gNMI path string
output_formatter.py: DummyTabularFormatter — JSON → table (test-mode only)
__init__.py: re-exports GnmiApiClient, main

How to verify it

Verified the running of main() and input formatter on BJLab device.
image

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant