Community discussions

MikroTik App
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Clarify "numbers" please!

Sun Sep 04, 2016 7:42 pm

Hello!

What excatly "numbers" means? I know, this is index returned by print command. But this contruction are correct too:

/interface list member add list=IFL_BILL_DISABLED interface=ether8 comment="qqq"
/interface list member remove numbers="qqq"

Regards,
Boris
 
pe1chl
Forum Guru
Forum Guru
Posts: 10550
Joined: Mon Jun 08, 2015 12:09 pm

Re: Clarify "numbers" please!

Sun Sep 04, 2016 8:25 pm

Numbers are only required when referring to existing items, i.e. only when modifying or deleting not when adding new items.
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Clarify "numbers" please!

Mon Sep 05, 2016 7:37 am

@pe1chl, of course I know that. As You can see in my example I remove one of item. But in "traditional" (?) scheme I must:
/interface list member print
/interface list member remove X

instead I may use /interface list member remove numbers="qqq" syntax, where qqq is just a comment for an item. So I wondering what numbers exactly means and how I may use it more effective?
Haven't found any docs about this.

Regards,
Boris
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Clarify "numbers" please!

Mon Sep 05, 2016 9:38 am

numbers field in RouterOS CLI accepts primarily internal item number. That number is the same number that is used to address items in API .id. For example, *4a. For CLI there are some useful additions made, like internal order number, that can be used instead of internal id number. In some lists, other fields can be used, usually, the name, if the items are named. Do not expect that if some list allows the use of item name, that items name is unique. For example, interface list allows the use of interface names field as a number, but there might be two interfaces with the same name. Same goes for PPP secret list - usually, usernames are unique, but there can be cases where it is not true.
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Clarify "numbers" please!

Mon Sep 05, 2016 8:52 pm

Ough my brain! Janisk, is there a way (especially for API queries) to exactly identify id of object I need to delete or modify?