update community.routeros.api query functionality (#63)

* update query to accept multiple librouteros ADN parameters

* update query for new yml strucutre

* add extended_query as separate function:(code in progress)

* extended_query main code is ready for review

* add changelog #63

* small fix for code indentation

* fix pep

* clear all pep issues

* extended_query ready for review (new yml structure)

* small doc fix for std query

* Update changelogs/fragments/63-add-extended_query.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/63-add-extended_query.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update argument spec.

* Other suggestions.

* Fix syntax errors ('is' and 'or' are keywords).

* Make everything work again.

* Add docs, simplify code.

* Add some first tests.

* Do not add fake message when there is no search result.

* Improve tests.

* Fix tests.

* update extened query docs and ros api module examples

* fix pep plugins/modules/api.py:154:1: W293: blank line contains whitespace

* fix extended query example intend

* Update plugins/modules/api.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/api.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix example docs

Co-authored-by: dako <dako@syslin.sof.dachev.lan>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Nikolay Dachev 2022-05-23 14:44:02 +03:00 committed by GitHub
parent 109e534976
commit d57de117f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 405 additions and 152 deletions

View file

@ -90,7 +90,7 @@ class fake_ros_api(object):
if result:
return result
else:
return ["no results for 'interface bridge 'query' %s" % ' '.join(args)]
return []
@classmethod
def select_where(cls, api, path):
@ -106,7 +106,7 @@ class Where(object):
return self
def where(self, *args):
return ["*A1"]
return [{".id": "*A1", "name": "dummy_bridge_A1"}]
class Key(object):
@ -116,3 +116,12 @@ class Key(object):
def str_return(self):
return str(self.name)
class Or(object):
def __init__(self, *args):
self.args = args
self.str_return()
def str_return(self):
return repr(self.args)