GideonLeGrange / mikrotik-java

A Java client implementation for the Mikrotik RouterOS API.
Apache License 2.0
177 stars 100 forks source link

/queue simple remove #56

Closed nikvs84 closed 6 years ago

nikvs84 commented 6 years ago

How to execute command /queue/simple/remove [/queue/simple/find comment={comment}] with java API? As a result of executing the command, I get an exception:

me.legrange.mikrotik.impl.ApiCommandException: unknown parameter
    at me.legrange.mikrotik.impl.ApiConnectionImpl$Processor.run(ApiConnectionImpl.java:263)
ambroseahurra commented 6 years ago

You could try List<Map<String, String> id = con.execute("/queue/simple/print where comment=xx return .id"); Then use the id to delete; con.execute("/queue/simple/remove .id="+id.get(0).get(".id")+""); Havent had any luck with using find over the API

GideonLeGrange commented 6 years ago

You can't use [/[/queue/simple/find ...] because you're effectively scripting which is not supported by the underlying API (limitation for RouterOS, not the Java library).

nikvs84 commented 6 years ago

@ambroseahurra, @GideonLeGrange, thanks!

BudFox80 commented 1 year ago

Thank U so mutch @ambroseahurra