I am trying to use the MikroTik API to get the same results as the command line command:
/ip hotspot active print where user=bokad
I have tried:
--------------1--------------------------
$API->write(‘/ip/hotspot/active/print’,false);
$API->write(‘=where=’,false);
$API->write(‘=user=bokad’,true);
Bummer. It’s kinda inefficient to transfer an entire list of 1600 logged in users across a slow connection when you just need information on one of them.
Do you know of any plans to implement find or where?
Is there a documentation source for the API with more information than the Wiki?
Anymore information on this?
I found the only way to remove a user is to use the .id field.
This does seem quite silly since you know the user name and the IP address, but not the ID, so why make it so you can only remove a user on a field that is not known to you unless you do a print and filter the results? That just adds overhead to the process, and not really all that logical…to me anyway.
exactly, queries showed up in 3.21 (3.22) and will stay there for long time, if you are using find, or plan using find, use queries and .proplist to get values you need, to avoid additional parsing of output.
unfortunately, you cannot use regular expression matching in API
if you need to match by name prefix and don’t want to receive all names to process them on client side, ugly workaround coud be like this: