api set and remove

hi i have a small question about set and remove in api

when i want to remove something i use this code

      if ($API->connect("$ip", "$user", "$pass")) {
      $API->write('/ppp/active/remove',false);
      $API->write("=.id=$id");
      $READ = $API->read(false);
      $ARRY  = $API->parse_response($READ);
      $API->disconnect();
      }

here i use " .id " to remove user from ppp/active

my question :

are it’s possible to replace " .id " with other thing like name or address

imean the code will be

      if ($API->connect("$ip", "$user", "$pass")) {
      $API->write('/ppp/active/remove',false);
      $API->write("=name=$name");
      $READ = $API->read(false);
      $ARRY  = $API->parse_response($READ);
      $API->disconnect();
      }

or

      if ($API->connect("$ip", "$user", "$pass")) {
      $API->write('/ppp/active/remove',false);
      $API->write("=address=$address");
      $READ = $API->read(false);
      $ARRY  = $API->parse_response($READ);
      $API->disconnect();
      }

Yes, but only in menus where the other thing is required to be unique, such as the name of a simple queue in the “/queue/simple” menu, interface name at the “/interface” menu, and a few others I can’t recall. I don’t think “/ppp/active” is one of those menus though.

thanks mr boen

Yes, but only in menus where the other thing is required to be unique, such as the name of a simple queue

how i can use set with name field in simple queue

i use this code

  if ($API->connect("$ip", "$user", "$pass")) {
   $API->write('/queue/simple/set',false);
   $API->write('=limit-at=10M/10M',false);
   $API->write('=max-limit=10M/10M',false);
   $API->write('=name=<pppoe-11>');
   $READ = $API->read(false);
   $ARRAY = $API->parse_response($READ);
   $API->disconnect();
 }

but nothing happen

it works when i use id field only

but its to hard to use id because every time i want to edit my simple queues or any thing i must to use print first then i take the id and use it with set, and it take a long time if i have many results

At the “.id” argument (or the equivalent “numbers” argument), use the name itself instead of the ID.

e.g.

   $API->write('/queue/simple/set',false);
   $API->write('=limit-at=10M/10M',false);
   $API->write('=max-limit=10M/10M',false);
   $API->write('=numbers=<pppoe-11>'); 

If you use the “name” argument, that will be considered the new name for a queue that previously had the name specified in “numbers”/“.id”.