mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add nso_query module to query Cisco NSO using XPath (#34188)
This commit is contained in:
committed by
John R Barker
parent
cd8632dd7f
commit
5bd8a8f491
@@ -170,6 +170,17 @@ class JsonRpc(object):
|
||||
resp, resp_json = self._read_call(payload)
|
||||
return resp_json['result']
|
||||
|
||||
def query(self, xpath, fields):
|
||||
payload = {
|
||||
'method': 'query',
|
||||
'params': {
|
||||
'xpath_expr': xpath,
|
||||
'selection': fields
|
||||
}
|
||||
}
|
||||
resp, resp_json = self._read_call(payload)
|
||||
return resp_json['result']['results']
|
||||
|
||||
def run_action(self, th, path, params=None):
|
||||
if params is None:
|
||||
params = {}
|
||||
|
||||
Reference in New Issue
Block a user