Community discussions

 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Another RouterOS API Delphi Client

Fri May 01, 2009 9:03 pm

It's my API client realization for Delphi7. It implements execution of parallel queries which are easily handled due to database-like interface.

v1.3: Added support for RouterOS 6.43+ API login method
v1.2: Added basic support for API over TLS
v1.1: Added Delphi 2009 compatibility (thanks to Anton Ekermans for testing)

Wiki page: http://wiki.mikrotik.com/wiki/API_Delphi_Client
GitHub page: https://github.com/Chupaka/Delphi-RouterOS-API/releases

Direct links to files:
Delphi-RouterOS-API-1.3.zip: https://github.com/Chupaka/Delphi-Route ... e/v1.3.zip
APITest-source-1.3.zip: https://github.com/Chupaka/Delphi-Route ... ce-1.3.zip
APITest-1.3.exe: https://github.com/Chupaka/Delphi-Route ... st-1.3.exe
Last edited by Chupaka on Thu Jun 13, 2013 4:40 pm, edited 3 times in total.
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
clink
just joined
Posts: 23
Joined: Sun Mar 30, 2008 12:30 pm

Re: Another RouterOS API Delphi Client

Sun Jun 21, 2009 4:39 pm

Hi Chupaka

I am searching some one there can help developing an api to the routeros.

Would you contact me at dev (at) sealink dot dk

The final result should make a communication from a web portal interface to the routerboard for activating predefined scripts on the routerboard ex. could be

The interface, API and scripts will give a user ex. in the reception of a hotel a https page where he can login. On this page the hotel have all network plugs for meeting rooms.
The user pick a room "center stage east" and choose 6 hours from the drop down menu and a few other parameters like which bandwidth there are required.
When he click execute button then it should establish a connection by the API to the routeros and execute a script which is on the routerboard.

For further details about your consulting please contact me.

B/R
Kenneth
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Sep 30, 2009 1:00 pm

Is this unit D2009 compatible? Should I convert all String to AnsiString to avoid Unicode clashes?

Thanks
Ekkas
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Thu Nov 05, 2009 2:10 pm

New version 1.1: Delphi 2009 compatibility (thanks to Anton Ekermans for testing)
Requires Synapse Release 39
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Thu Nov 05, 2009 4:31 pm

oops... reuploaded with fixed typo in version history: it's Nov, not Oct :oops:
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Sat Nov 07, 2009 3:30 am

Thanks a lot Chupaka, for your good work,
it will help me a lot.
 
lcosta
just joined
Posts: 2
Joined: Mon Jan 11, 2010 7:41 pm

Re: Another RouterOS API Delphi Client

Sat Jan 23, 2010 9:59 pm

Chupaka,
very good work with "RouterOSAPI.pas" I am a doubt, because not found any procedure in the engine ROSAPI for when the connection to incorrectly, you already did something for this case?? to be clearer for example when Winbox this running and for some reason it loses connectivity to the server then it terminates the application, I am trying to do that! you can help me?
 
lcosta
just joined
Posts: 2
Joined: Mon Jan 11, 2010 7:41 pm

Re: Another RouterOS API Delphi Client

Sat Jan 23, 2010 10:11 pm

It's my API client realization for Delphi7. It implements execution of parallel queries which are easily handled due to database-like interface.

v1.1: Added Delphi 2009 compatibility (thanks to Anton Ekermans for testing)

Wiki page: http://wiki.mikrotik.com/wiki/API_Delphi_Client
RouterOSAPI-1.1.zip
APITest-1.1.zip
APITest-Bin-1.1.zip
Chupak,

very good work with "RouterOSAPI.pas" I have some doubts, because not found in any procedure for ROSAPI engine stoped when the connection incorrectly, you already did something for this case?? to be clearer for example when Winbox this running and for some reason it loses connectivity to the server then it terminates the application, I am trying to do that! you can help me?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 2:39 pm

unfortunately, there's no such functions. you may try to check Synapse Socket state directly
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 4:43 pm

Hey Chupaka! Hope you're doing well...

I've been developing some very nice stuff with ROS to read info from my +-200 RBs, it's really great!
But I have a question:
How do I set a value using ROSAPI? e.g. i can read 'hw-protection-mode' by:
Res := ROS.Query(['/interface/wireless/print'], True);
if not Res.Trap
then begin
ShowMessage(Res['hw-protection-mode']);
end;
but how do I set the value to e.g. 'hw-protection-mode=rts-cts' ?


Anton Ekermans
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 5:06 pm

Res := ROS.Query(['/interface/wireless/set', '=.id=*bla-bla-bla', '=hw-protection-mode=HERE'], True);
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 8:35 pm

Sorry for the trouble, but I run the command:
Res:=ROS.Query(['/interface/wireless/set', '=.id=*1234', '=hw-protection-mode=client-mode'], True);

It returns without error, but the value stays unchanged?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 8:53 pm

just tested with v4.5...
/interface/wireless/print
=.proplist=.id,hw-protection-mode
returns
!re=
=.id=*6
=hw-protection-mode=none
now change hw-protection-mode:
/interface/wireless/set
=.id=*6
=hw-protection-mode=cts-to-self
and after that query again, response is
!re=
=.id=*6
=hw-protection-mode=cts-to-self
tested using 'APITest' application from the first post...
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 9:19 pm

I did not bother using the .id returned from first query and just gave it a random number, I suppose that is my problem.
Thanks.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Mon Jan 25, 2010 9:24 pm

:D sure it is )))
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
hrico
just joined
Posts: 12
Joined: Wed Dec 16, 2009 2:25 am

Re: Another RouterOS API Delphi Client

Wed May 05, 2010 1:28 pm

To Chupaka:
Im trying do develop something similar in C# using the help from http://wiki.mikrotik.com/wiki/API_in_C_Sharp, but I have some problems concerning sending the requests:
I run the application, Login forms po-pup - input login,passwd, connect successfully, main application window is open.
And now if I want to execute(send) certain commands to the router I use the same function,which was used to create connection at the beginning but without login function. But then I get response from router about !fatalogin.
Is it necessary to use login and passwd, set at the beginning, to execute(send) each command sentence to the router? How do you do it?

Maybe I'm doing the whole thing wrong, but I thought it could work.

PS:I don't work with Delphi at all so your code does not really help me.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed May 05, 2010 1:52 pm

You shouldn't need to send the login info with each request, as long as you maintain (keep open) the same session/conection.
Once the session is authenticated, it should work on the same session.
Maybe you can generate an exact log of what you send/receive and post it here, that might be easier to see what's wrong as C code would not make any sense to a Delphi-only programmer like me either. (Or at least compare the log with the API wiki)

Ekkas
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6276
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Another RouterOS API Delphi Client

Thu May 06, 2010 9:09 am

anyway, if we see what output you have, we could say where is the problem.

And as previously said - basic steps are - make tcp/ip connection, authenticate w/ /login, send commands, close connection.
now every part in bit more detail
1) making of connection - easy part, simple connection
2) /login part - you have to follow the procedure carefully, getting challenge, forming reply and getting positive reply that you are in
3) sending commands - on each command you send you will get reply. if you use several commands that will run for some time (/ping, something with =follow=) use .tag, to tag replies
4) when you are done, terminate connection.
 
hrico
just joined
Posts: 12
Joined: Wed Dec 16, 2009 2:25 am

Re: Another RouterOS API Delphi Client

Thu May 06, 2010 11:02 am

Thanks for your replies.

I already got to the point 3 where I can send comands without problems(but only one at the same time) except these two:
/interface/monitor-traffic
/interface/wireless/scan

- the first one works only with argumnent once.
- is sth like once also by the scan?

I will be probably sending more request at the same time( for example I will monitor bandwidth and I will also want to get info about some interface..), so you think just to tag the reqest is enough? Because I was thinking about threading, where especially those commands like monitor,scan etc will be send through one of these threads.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Fri May 07, 2010 2:38 pm

hmmm... maybe the problem is you are waiting for '!done', but those command you should stop manually by '/cancel'?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
hrico
just joined
Posts: 12
Joined: Wed Dec 16, 2009 2:25 am

Re: Another RouterOS API Delphi Client

Sat May 08, 2010 11:57 am

Yes, you were right. When I debugged it I found out that it sends replies but never ends because there is no !done. But even if I put /cancel at the end, it never gets to this cancel.
mikrotik.Send("/interface/monitor-traffic");
mikrotik.Send("=interface=ether1");
mikrotik.Send("/cancel", true);
... is there any workaround?

I've used as a source this site http://wiki.mikrotik.com/wiki/API_in_C_Sharp.
Do you know maybe how to change the code so it would not always wait for this !done?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Sun May 09, 2010 11:41 pm

you should execute your query, read necessary results and then stop it by executing "/cancel"
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
pro2
just joined
Posts: 16
Joined: Mon Apr 17, 2006 5:02 am

Re: Another RouterOS API Delphi Client

Tue Jan 25, 2011 7:13 pm

Gostaria de sabe como removo um linha no firewall, no ssh eu uso assim como faz o mesmo na api-delphi


"I would like to know how to remove a line in the firewall, I use ssh in and do the same in-api delphi"


/ip firewall nat remove [/ip firewall nat find src-address=10.0.0.1]
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Jan 26, 2011 9:15 am

There might be a shorter way, but I update address list by getting e.g.
/ip/firewall/address-list/print','?list=mylist'
Then parse the results an get the .id of the record I want to change.
Then do a
'ip/firewall/address-list/remove','=.id='+theid
Hope it helps.

Ekkas
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6276
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Another RouterOS API Delphi Client

Wed Jan 26, 2011 9:37 am

this basically is the way how you do that.

get the ID of the entry and remove by ID.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 12:49 am

when I do a 'query' from terminal window:
/tool user-manager user print count-only

I get an instant response, in this case 6925

But when I run API command:
Res:=ROS.Query(['/tool/user-manager/user/print','=count-only'],True);

Then it takes about 10 seconds to complete.
  • Am I doing the API command wrong?
    is it just how API works?
    Is it a possible new feature request?
Thanks
Ekkas
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 4:14 pm

do you have the same result in case of API?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 4:27 pm

What do you mean?
Terminal= instant

API =very slow
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 4:33 pm

I mean, what do you receive in API response?
in both v4.2 and v5.0rc10 I get empty response if I try to use '=count-only' (I'm checking /ip/address/print) - seems like it doesn't work at all
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 4:58 pm

Using your APItest:


Connected!
Version: 4.16
!done=
=ret=7145
----------------
================
APIcount.JPG
You do not have the required permissions to view the files attached to this post.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 6:11 pm

then you should write to support@, I believe :)

p.s. please mention that it doesn't work for /ip/address/print =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 8:18 pm

I'll write to support.

It works for me on ip (ROS 4.16):
API2.JPG
You do not have the required permissions to view the files attached to this post.
Last edited by ekkas on Wed Mar 02, 2011 8:24 pm, edited 1 time in total.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Wed Mar 02, 2011 8:23 pm

And in ROS 5rc9:
API3.JPG
You do not have the required permissions to view the files attached to this post.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Thu Mar 03, 2011 12:55 am

argh, it's returned in the same sentence as '!done', so "Query & Listen" do not see it %) "Query & Get All" works fine, sorry for inconvenience :)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Thu Mar 03, 2011 12:59 am

No Problem. I always use getall. lol


Maybe you can help me with this one:
http://forum.mikrotik.com/viewtopic.php?f=9&t=49660
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6276
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Another RouterOS API Delphi Client

Thu Mar 03, 2011 1:44 pm

if i remember correctly, then some long time ago getall was an alias for print, so you get same stuff using getall or print commands using API, and for details you have to use =detail= (not so old change)
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Thu Mar 03, 2011 5:11 pm

for details you have to use =detail= (not so old change)
please correct the docs: http://wiki.mikrotik.com/wiki/API#Command_description
if .proplist is absent, all possible properties are included, even those that have slow access time (such as file contents and perfomance counters). Thus use of .proplist is encouraged. Omission of .proplist may have high perfomance penalty.
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6276
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Another RouterOS API Delphi Client

Mon Mar 07, 2011 11:16 am

thanks for pointing that out, wording has been updated.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Mon Mar 07, 2011 1:21 pm

huh, from the same place:
arguments that modify list of returned properties (detail, breif, ...) have no effect in the API
:)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6276
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Another RouterOS API Delphi Client

Mon Mar 07, 2011 2:32 pm

edit-search-done. :oops:
 
tara
just joined
Posts: 6
Joined: Thu Dec 15, 2011 6:45 pm

Re: Another RouterOS API Delphi Client

Thu Dec 15, 2011 6:54 pm

hello. excuse my English.
how do I run this command because I have tried various ways and does not serve me.
ip hotspot active remove [/ip hotspot active find]
and tried and not working
ip/hotspot/active/remove 
=[=
=ip=
=hotspot=
=active=
=find=
=]=
or can give me a help to disconnect all active users in hotspot
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Fri Dec 16, 2011 1:08 am

how do I run this command because I have tried various ways and does not serve me.
ip hotspot active remove [/ip hotspot active find]
first,
/ip/hotspot/active/print
=.proplist=.id
then,
/ip/hotspot/active/remove
=.id=comma-separated-list-of-ids-from-prevoius-command-result
or can give me a help to disconnect all active users in hotspot
hmmm... maybe just disable HotSpot?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
gladiopeace
newbie
Posts: 37
Joined: Thu Dec 08, 2011 4:28 pm

Re: Another RouterOS API Delphi Client

Wed Aug 01, 2012 5:42 pm

hello how i can connect api via alternative api port?
best regards Gladio peace
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Wed Aug 01, 2012 5:45 pm

function Connect(const Hostname, Username, Password: AnsiString; const Port: AnsiString = '8728'): Boolean;
so, add a string parameter with port number after the password
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
gladiopeace
newbie
Posts: 37
Joined: Thu Dec 08, 2011 4:28 pm

Re: Another RouterOS API Delphi Client

Wed Aug 01, 2012 5:50 pm

Chupaka you're amazing, i love your beautiful mind:)
 
gladiopeace
newbie
Posts: 37
Joined: Thu Dec 08, 2011 4:28 pm

Re: Another RouterOS API Delphi Client

Fri Aug 03, 2012 9:10 pm

how i can set timeout for "ROS.Query"
kind regards Gladio Peace.
 
leonardocx
just joined
Posts: 3
Joined: Sat Sep 01, 2012 5:50 pm

Re: Another RouterOS API Delphi Client

Tue Sep 04, 2012 7:29 pm

I wonder how do I include the following eating via api, this command works fine in terminal via mikrotik wimbox


  / queue / simple / add name = "Leonardo Xavier" target-addresses = "192.168.2.34"
max-limit = "256K/256K" burst-limit = "512K/512K" burst-threshold = "256K/256K" burst-time = "60/6
0 "
 
User avatar
Chupaka
Forum Guru
Forum Guru
Topic Author
Posts: 8212
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Another RouterOS API Delphi Client

Fri Sep 07, 2012 2:49 pm

I wonder how do I include the following eating via api, this command works fine in terminal via mikrotik wimbox


  / queue / simple / add name = "Leonardo Xavier" target-addresses = "192.168.2.34"
max-limit = "256K/256K" burst-limit = "512K/512K" burst-threshold = "256K/256K" burst-time = "60/6
0 "
API and CLI (Terminal) are different things. in API, command should look like this:
/queue/simple/add
=name=Leonardo Xavier
=target-addresses=192.168.2.34
=max-limit=256000/256000
=burst-limit=512000/512000
=burst-threshold=256000/256000
=burst-time=60/60
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
leonardocx
just joined
Posts: 3
Joined: Sat Sep 01, 2012 5:50 pm

Re: Another RouterOS API Delphi Client

Wed Sep 19, 2012 11:49 pm

thank Chupaka
but solved this problem a few days ago, now I want to see if I can remove a client's specific mikrotik via its api, I'm having trouble with the command to locate the customer, and isolates it from the other, because the print command and not find me retronam via WinBox values ​​which can not hold a charge for this type of association as I did with the other commands, testing them in wimbox first.
Another thing about the backup could generate the file with the following command:

/ system / files / backup / save

the file appears in the files wimbox perfect as backup, but how to make a print this file in a memo field? even how to get this file?
 
ekkas
Long time Member
Long time Member
Posts: 562
Joined: Mon Sep 26, 2005 1:01 pm
Location: South Africa

Re: Another RouterOS API Delphi Client

Fri Oct 26, 2012 4:21 pm

Hey Chupaka
I have this component running great for a long time, since before Delphi 2009.
But there is a problem with multi-threading.
I put whole component inside a thread and sometimes, with few instances in different threads, connecting to different routers, all threads (or just 1) would just hang.
Almost like a lockup in critical section or something.
I could not pinpoint where it hang yet, but I thought maybe you could give me some pointer what I could look for, or maybe is it a limitation/bug in Syapse libs?

Thanks
Ekkas

Who is online

Users browsing this forum: No registered users and 2 guests