Hello,
What is API equivalent to ‘print count-only’ command?
E.g. I want to retrieve number of router user (‘/user/print count-only’)
TIA,
Hello,
What is API equivalent to ‘print count-only’ command?
E.g. I want to retrieve number of router user (‘/user/print count-only’)
TIA,
/ip/address/print
=count-only=
specifically for user count
/user/print
=count-only=
remember, API is CLI equivalent, not winbox ![]()
CLI directly translates to API, in winbox to make it more readable some features are places elsewhere.
so, in CLI same command looks like this:
/user print count-only
and it is coloured in certain way where you can rcognize, that /user is menu print is actual command you are running inside the menu and count-only is command attribute.
in API you place forward slash instead of space, so
/menu/command
=atribute=value
in this case, attribute has no meaningful value, so empty space can be used.
for example in CLI
/ip address add address=192.168.88.1/24 interface=ether1
results in:
/ip/address/add
=address=192.168.88.1/24
=interface=ether1
so skeleton of the API command is
/menu/menu/command
=attribute1=value
=attribute2=value2
@janisk
Thank you very much for this explanation, my life will be a little bit easier now ![]()
Regards,