Thanks for answer Eugene. Zexplore doesn't seem to help me, however.
I wish to avoid spending several lines by building a hierarchy of NaElement objects to get a simple "state = restricted" filtering query, which is what Zexplore does. Instead, I look for an elegant way to directly pass query or desired-attributes arguments to invoke method, not to invoke_elem one. Something in the way of the example I've provided in original post.
Instead of quite chaotic this:
api = NaElement("volume-get-iter")
xi = NaElement("desired-attributes")
api.child_add(xi)
xi1 = NaElement("volume-attributes")
xi.child_add(xi1)
xi1.child_add_string("volume-id-attributes","<volume-id-attributes>")
xi2 = NaElement("query")
api.child_add(xi2)
xi3 = NaElement("volume-attributes")
xi2.child_add(xi3)
xi4 = NaElement("volume-state-attributes")
xi3.child_add(xi4)
xi4.child_add_string("state","restricted")
xo = s.invoke_elem(api)
I wish to write something like this:
xo = s.invoke("volume-get-iter", "desired-attributes", ("volume-attributes", ("volume-id-attributes",)), "query", ("volume-attributes", ("volume-state-attributes", ("state", "restricted"))))
I just wonder if the Python Ontapi implements similar syntax. I have tried to use that without success.
Lukas