Community discussions

 
moly
newbie
Topic Author
Posts: 34
Joined: Tue Dec 06, 2005 3:14 pm
Contact:

/queue simple move in API?

Wed Jan 28, 2009 4:25 pm

Hi, it is possible to make function /queue simple move in API?
Please give me syntax.

Thanx
Martin Cerny
chairman of Oslavany.NET
 
mumu
just joined
Posts: 2
Joined: Fri Jan 23, 2009 12:18 pm

Re: /queue simple move in API?

Wed Jan 28, 2009 7:37 pm

/queue/simple/move
=.id=queue1
 
moly
newbie
Topic Author
Posts: 34
Joined: Tue Dec 06, 2005 3:14 pm
Contact:

Re: /queue simple move in API?

Wed Jan 28, 2009 9:17 pm

/queue/simple/move
=.id=queue1
But, I need two variables. Queue whitch I need to move and Queue where I want to move ahad.

in console is :
/queue/simple/move "queue to move" "destination queue"

Thanx
Martin Cerny
chairman of Oslavany.NET
 
maikorodrigo
just joined
Posts: 6
Joined: Wed Mar 18, 2009 2:14 pm
Location: Medianeira/PR/Brasil
Contact:

Re: /queue simple move in API?

Wed Mar 18, 2009 2:18 pm

any positive result?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: /queue simple move in API?

Fri Mar 20, 2009 1:49 pm

/queue/simple/move
=.id=*7E
=.id=*1
move queue with id=*7E before queue with id=*1
 
maikorodrigo
just joined
Posts: 6
Joined: Wed Mar 18, 2009 2:14 pm
Location: Medianeira/PR/Brasil
Contact:

Re: /queue simple move in API?

Fri Mar 20, 2009 9:46 pm

/queue/simple/move
=.id=*7E
=.id=*1
move queue with id=*7E before queue with id=*1

does not work, the queue is moved to the end

all queues before run php

*19 - queue1
*1A - queue2
*1B - queue3
*1C - queue4
*1D - queue5
*1E - queue6
*1F - queue7
*20 - queue8



run php:

<?php
require('classeAPI.php');

$API = new routeros_api();

$API->debug = true;

if ($API->connect(XXXXXXXX, 'XXXXX', 'xxxxxx'))
{

$API->write('/queue/simple/move',false);
$API->write('=.id=*1D',false);
$API->write('=.id=*1B');

$ARRAY = $API->read();

$API->disconnect();
}
?>



after run php:

*19 - queue1
*1A - queue2
*1C - queue4
*1D - queue5
*1E - queue6
*1F - queue7
*20 - queue8
*1B - queue3

as you can see, the queue has been moved to the end .. any idea ???
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: /queue simple move in API?

Mon Mar 23, 2009 2:46 pm

ok, some clarification.


this will move queue with .id to last position
/queue/simple/move
=.id=<queue id>

this will move queue witdh ID before queue with ID2
/queue/simple/move
=numbers=<queue id>
=destination=<queue id2>
this will move queues with ID, ID2, ID1 to the end in same order as in command
/queue/simple/move
=.id=<queue id>,<queue id2>,<queue id3>
in console we see:
 > queue simple move
Reorders source list of items so that first has destination number and the rest follows it in given order.

<numbers> -- List of item numbers
<destination> -- 
 
maikorodrigo
just joined
Posts: 6
Joined: Wed Mar 18, 2009 2:14 pm
Location: Medianeira/PR/Brasil
Contact:

Re: /queue simple move in API?

Tue Mar 24, 2009 2:29 pm

yes, yes, yes


thank you...
 
moly
newbie
Topic Author
Posts: 34
Joined: Tue Dec 06, 2005 3:14 pm
Contact:

Re: /queue simple move in API?

Wed Apr 01, 2009 3:48 pm

thank you very much
Martin Cerny
chairman of Oslavany.NET
 
maikorodrigo
just joined
Posts: 6
Joined: Wed Mar 18, 2009 2:14 pm
Location: Medianeira/PR/Brasil
Contact:

Re: /queue simple move in API?

Fri Nov 13, 2009 12:52 pm

using this command for change target-address:

if($linha['ip'] != $ip && $ip != ""){

require('includes/api/classeAPI.php');

$API = new routeros_api();

$API->debug = true;

if ($API->connect($ip_mk,$user_mk,$pass_mk)){
$API->write('/queue/simple/set',false);
$API->write('=numbers='.$login.'',false);
$API->write('=target-address='.$ip.'');
$API->read();
$API->disconnect();
} else {
die("Nao foi possivel conectar: ".$ip_mk);
}
}

response on v3.30 (RB411AH):


Connection attempt #1 to 189.75.174.52:8728... <<< [6] /login >>> [5/5 bytes read. >>> [5, 39] !done >>> [37/37 bytes read. >>> [37, 1] =ret=040a6caaeaf0610984b8def5df3a6df2 <<< [6] /login <<< [11] =name=admin <<< [44] =response=00db3d00d37f7ccd5ace78168ebabf903c >>> [5/5 bytes read. >>> [5, 1] !done Connected... <<< [17] /queue/simple/set <<< [33] =numbers=Felipe Nazario Lima Chen <<< [35] =target-address=10.2.2.9,10.2.2.100 >>> [5/5 bytes read. >>> [5, 35] !trap >>> [26/26 bytes read. >>> [26, 8] =message=unknown parameter >>> [5/5 bytes read. >>> [5, 1] !done Disconnected...


response on v3.23 (PC x86):

Connection attempt #1 to 200.138.161.132:8728... <<< [6] /login >>> [5/5 bytes read. >>> [5, 39] !done >>> [37/37 bytes read. >>> [37, 1] =ret=c6ce2fc945a3cc973a201996300594c5 <<< [6] /login <<< [11] =name=admin <<< [44] =response=000030986a1214543ff4dd978fa08049fd >>> [5/5 bytes read. >>> [5, 1] !done Connected... <<< [17] /queue/simple/set <<< [22] =numbers=Paulo Martins <<< [29] =target-address=192.168.96.14 >>> [5/5 bytes read. >>> [5, 1] !done Disconnected...


whats a problem with v3.30 on target-address parameter ? help please...
 
maikorodrigo
just joined
Posts: 6
Joined: Wed Mar 18, 2009 2:14 pm
Location: Medianeira/PR/Brasil
Contact:

Re: /queue simple move in API?

Fri Nov 13, 2009 1:11 pm

howwwwwwwwwwwww howwwwwwwwww


in v3.30 parameter "target-address" is changed to "target-addresses"


thankssssss all
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8308
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: /queue simple move in API?

Fri Nov 13, 2009 2:32 pm

in v3.30 parameter "target-address" is changed to "target-addresses"
actually, v3.23 simply allowed shortened parameter names (you can use 'target-a' in v3.23). as far as I remember, it was me who advised to remove that feature from API :D
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.

Who is online

Users browsing this forum: No registered users and 3 guests