Community discussions

MikroTik App
 
rado3105
Member
Member
Topic Author
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Api to connect to router, disable queue simple

Thu Aug 21, 2014 5:13 pm

Is possible to create api to log in router, disable queue simple....?
can anybody help to create it?
thanks
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Api to connect to router, disable queue simple

Thu Aug 21, 2014 6:05 pm

Using which API client?

With my PHP client, it would be as simple as
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b4.phar';

$client = new RouterOS\Client('routerip', 'admin', 'password');
$client->sendSync(new RouterOS\Request('/queue simple disable numbers=queueName'));
Where "queueName" is the name of the queue you want disabled.


It would be similar using other API clients... Perhaps with a few more lines of code, but still trivial.
 
rado3105
Member
Member
Topic Author
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Re: Api to connect to router, disable queue simple

Thu Aug 21, 2014 6:21 pm

I want to use it from routeros to routeros, what client will be ideal (simple and working in this case?)
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Api to connect to router, disable queue simple

Thu Aug 21, 2014 6:27 pm

You can't. RouterOS does not have an API client, and you can't install any external applications on it.

You'd need a separate non-RouterOS device (e.g. a web server, or just some workstation) to contain and run the application.
 
rado3105
Member
Member
Topic Author
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Re: Api to connect to router, disable queue simple

Thu Aug 21, 2014 6:38 pm

thanks, I just realized that I can use SSH:)
 
nonac
newbie
Posts: 27
Joined: Tue Sep 02, 2014 7:36 pm

Re: Api to connect to router, disable queue simple

Sun Oct 05, 2014 12:46 pm

use SSH:) :lol:
 
rado3105
Member
Member
Topic Author
Posts: 492
Joined: Sat Jan 12, 2008 11:45 pm

Re: Api to connect to router, disable queue simple

Thu Nov 27, 2014 9:17 pm

but problem is that it cant be used in script..also telnet...can anybody help how to connect from one routeros device to another one using script?
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: Api to connect to router, disable queue simple

Sat Nov 29, 2014 12:10 am

You could use fetch and upload something.auto.rsc file from the first router to the second via FTP. The script is automatically executed after upload. Docs here.

This example is more complicated than what you want, but at it's core is doing what I described above.
http://forum.mikrotik.com/viewtopic.php ... 59#p346592

Who is online

Users browsing this forum: No registered users and 12 guests