Skip to content

Commit e0f0254

Browse files
author
kkumara3
committed
added cli show command output json
1 parent 64b8db2 commit e0f0254

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

client/cisco_grpc_client.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def getoper (self, path):
106106
return objects
107107

108108
def showcmdtextoutput (self, cli):
109-
""" Get of CLI show commands
109+
""" Get of CLI show commands in text
110110
:param data: cli show
111111
:type data: str
112112
:return: Return the response object
@@ -115,5 +115,26 @@ def showcmdtextoutput (self, cli):
115115
stub = ems_grpc_pb2.beta_create_gRPCExec_stub(self._channel)
116116
message = ems_grpc_pb2.ShowCmdArgs(cli = cli)
117117
response = stub.ShowCmdTextOutput(message, self._timeout, metadata = self._metadata)
118+
objects = ''
119+
for response in responses:
120+
objects += response.output
121+
return objects
122+
123+
def showcmdjsonoutput (self, cli):
124+
""" Get of CLI show commands in json
125+
:param data: cli show
126+
:type data: str
127+
:return: Return the response object
128+
:rtype: str
129+
"""
130+
stub = ems_grpc_pb2.beta_create_gRPCExec_stub(self._channel)
131+
message = ems_grpc_pb2.ShowCmdArgs(cli = cli)
132+
response = stub.ShowCmdJSONOutput(message, self._timeout, metadata = self._metadata)
133+
objects = ''
134+
for response in responses:
135+
objects += response.jsonoutput
136+
return objects
137+
138+
118139

119140

0 commit comments

Comments
 (0)