Community discussions

Search found 22 matches

by legrang
Fri Aug 25, 2017 8:52 am
Forum: General
Topic: REST API v7 Make Our Day ! +1 it Please
Replies: 17
Views: 6233

Re: REST API v7 Make Our Day ! +1 it Please

All of that said, I think there is something MikroTik can do to fix the perception of the API, and that is to rework the language and organization of the manual... The current Manual:API page should instead be renamed to "API Protocol Specification", the section "Examples" should be changed to "Exa...
by legrang
Thu Aug 24, 2017 5:08 pm
Forum: Scripting
Topic: Bad API performance on /ip/route/print
Replies: 0
Views: 320

Bad API performance on /ip/route/print

Hi I'm working on an application that uses /ip/route/print through the RouterOS API to gather some routing table data. The performance of this operation is really bad, and it seems to diminish geometrically as routing table size increases. For example, on the command line the following command is ba...
by legrang
Tue Aug 22, 2017 8:28 pm
Forum: Scripting
Topic: API "where in" syntax
Replies: 4
Views: 1502

Re: API "where in" syntax

18 months on I was again looking at this problem and a Google for an answer brought me to this thread. I've forgotten that I posted this.

It would have been funny if it wasn't so infuriating that the API still cannot do this.

Gideon
by legrang
Thu Apr 20, 2017 2:22 pm
Forum: Scripting
Topic: Java API: filtering in {set,remove} commands
Replies: 2
Views: 658

Re: Java API: filtering in {set,remove} commands

The limitation as explained by @boen_robot is correct. If your reason for condensing the code is efficiency (i.e. making fewer API calls), then you're out of luck. But I don't think that loop should be particularly slow or inefficient, removing VLANs should not be regular an occurrence anyway :) If ...
by legrang
Sat Oct 08, 2016 8:08 pm
Forum: Scripting
Topic: Which Charset does Mikrotik use for displaying Arabic and how to convert a string to UTF-8
Replies: 5
Views: 1690

Re: Which Charset does Mikrotik use for displaying Arabic and how to convert a string to UTF-8

@AmrSubZero I think I have a fix for this. If you want to test the fix, please pull the current master branch from github and build and try that version. As an experiment, I've changed the internal encoding for transmission between the mikrotik-java API and RouterOS to be UTF-8 and it seems to solve...
by legrang
Tue Feb 23, 2016 12:03 pm
Forum: Scripting
Topic: Problem "add new user with profile" JAVA CODE
Replies: 1
Views: 830

Re: Problem "add new user with profile" JAVA CODE

Don't use the example code from the wiki - it's difficult to use, requires intimate knowledge of the RouterOS API and doesn't really have error handling. Rather use this library: https://github.com/GideonLeGrange/mikrotik-java. If you follow the examples in the README, you'll hopefully get further.
by legrang
Wed Jan 20, 2016 4:07 pm
Forum: Scripting
Topic: [API bug/suggestion] Regex in queries
Replies: 14
Views: 4701

Re: [API bug/suggestion] Regex in queries

As API implementation developer (not just API user), it would be really nice if I could have some pre-release info so I can adapt the Java API and be ready to release an update when v7.0 leaves beta *hint* *hint* :D

But good news!
by legrang
Mon Jan 04, 2016 9:40 pm
Forum: Scripting
Topic: API "where in" syntax
Replies: 4
Views: 1502

API "where in" syntax

Hi I recently became aware that you can use a "in" operator in a command line query, for example: /ip address print where address in 192.168.1.0/24 Is there a way to do this in the RouterOS API? I've read the API wiki page, but I can't see it, and haven't been able to figure it out with experimentat...
by legrang
Wed Jul 29, 2015 4:28 pm
Forum: Announcements
Topic: MikroTik smartphone app (ex Tik-App)
Replies: 428
Views: 146919

Re: Tik App, MikroTik android utility ALPHA test

I've figured out what the problem with my login was. I use more than one Google account and despite being singed in with the account associated the G+ group, I had to sign out the other accounts to access the download page. As to this: OK, again. first link = sign up. WHEN YOU HAVE BEEN CONFIRMED: s...
by legrang
Wed Jul 29, 2015 3:42 pm
Forum: Announcements
Topic: MikroTik smartphone app (ex Tik-App)
Replies: 428
Views: 146919

Re: Tik App, MikroTik android utility ALPHA test

Doesn't work.
Screen Shot 2015-07-29 at 14.40.20.png
by legrang
Tue Jul 14, 2015 12:21 pm
Forum: Scripting
Topic: [API proposal] "/help" command
Replies: 6
Views: 1948

Re: [API proposal] "/help" command

I really wish MikroTik would consider raising the priority on this. Here is my slightly philosophical view on the matter. We are in a world of software services running everything, with automation and integration becoming the norm. APIs are no longer afterthoughts, but are designed into the core of ...
by legrang
Sun Jul 12, 2015 9:16 pm
Forum: Scripting
Topic: [API bug/suggestion] Regex in queries
Replies: 14
Views: 4701

Re: [API bug/suggestion] Regex in queries

This has come up again, see: http://forum.mikrotik.com/viewtopic.php?p=490459

Moore's law and the recurring questions about this should surely be an indication that this feature should be reconsidered?

Gideon
by legrang
Sun Jul 12, 2015 3:08 pm
Forum: Scripting
Topic: ~ operator in API calls
Replies: 1
Views: 890

~ operator in API calls

Hello I wrote and maintain a OSS Java library for the RouterOS API and received the following query from a user: Im trying to use the following commands bellow but i'm getting a grammar error: /ip/dhcp-server/lease/print where comment ~'#Router#' /ip/dhcp-server/lease/print where comment ~'^#Router#...
by legrang
Wed Oct 08, 2014 7:27 am
Forum: Scripting
Topic: API Java monitor-traffic
Replies: 26
Views: 6506

Re: API Java monitor-traffic

Scanning for projects... Some problems were encountered while building the effective model for me.legrange:mikrotik:jar:1.1.7-SNAPSHOT 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-gpg-plugin is missing. @ line 72, column 21 It is highly recommended to fix these problems because...
by legrang
Mon Jun 30, 2014 1:34 pm
Forum: Scripting
Topic: API Java monitor-traffic
Replies: 26
Views: 6506

Re: API Java monitor-traffic

when I read for example (/ip/hotspot/user/print), your API returns one string containing all informations about the users. I want to get this string and make java objects with the attributes. Can you help? The API does not return one String. It returns a List containing Maps for the individual resu...
by legrang
Fri May 16, 2014 8:44 pm
Forum: Scripting
Topic: API Java monitor-traffic
Replies: 26
Views: 6506

Re: API Java monitor-traffic

Maybe add a new method to the listener that will get error replies? If mandatory, it would make users more cautious with their error handling... which tends to be a good thing. That, or perhaps adjust the listener to accept a Response, and adjust the Response to contain the type. (And most importan...
by legrang
Fri May 16, 2014 6:16 pm
Forum: Scripting
Topic: API Java monitor-traffic
Replies: 26
Views: 6506

Re: API Java monitor-traffic

Yeah, about that... you're already accepting ".id", and ".proplist" is just another argument name... Why introduce a new keyword? Seems unnecessary. (I think I know enough about Java and the API protocol, so hit me with the non-dumbed down version of the explanation) Clearly you know the API protoc...
by legrang
Fri May 16, 2014 12:34 pm
Forum: Scripting
Topic: API Java monitor-traffic
Replies: 26
Views: 6506

Re: API Java monitor-traffic

The following code works for me: String id = con.execute("/interface/monitor-traffic interface=wlan1 return tx-bits-per-second,rx-bits-per-second", new ResultListener() { public void receive(Map<String, String> result) { System.out.println(result); } }); Some notes: * I specify the interface with "i...
by legrang
Mon Dec 30, 2013 2:12 pm
Forum: Scripting
Topic: API Links
Replies: 123
Views: 85577

Re: API Links

I have written a Java client library for the Mikrotik API. The library, source code and examples can be found here: https://github.com/GideonLeGrange/mikrotik-java Current version is 1.0, with 1.1 - which will support TLS encryption - due shortly. I appreciate all questions and comments. - Gideon
by legrang
Fri Jul 05, 2013 2:09 pm
Forum: General
Topic: RouterOS API over TLS
Replies: 21
Views: 6589

Re: RouterOS API over TLS

I spoke too soon. Using -tls1 does't cause the scan to work in all cases. I intermittently have the same problem with a RB750 and Groove, both running 6.1.
by legrang
Fri Jul 05, 2013 11:54 am
Forum: General
Topic: RouterOS API over TLS
Replies: 21
Views: 6589

Re: RouterOS API over TLS

I'm was having the reported trouble with sslscan when testing against a RB750G running 6.1. sslcan was hanging. I found that passing the --tls1 parameter (i.e. not scanning ssl2 and ssl3) the scan works: bash-3.2# sslscan --tls1 10.0.1.3:8729 | grep Accepted Accepted TLSv1 256 bits ADH-AES256-SHA Ac...
by legrang
Wed Nov 03, 2010 4:19 pm
Forum: General
Topic: Freeradius PoD
Replies: 26
Views: 8142

Re: Freeradius PoD

my radclient shared secret is right, and one fact a confirm it. if you look carefully you can see that thirst disconnect message reply is Disconnect-ACK and user was sucessfully kicked from NAS, but in answer is still error message and radclient retry request got the Disconnect-NAK and error 503 st...