Page 1 of 1

Clarify "numbers" please!

Posted: Sun Sep 04, 2016 7:42 pm
by borisk
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

Re: Clarify "numbers" please!

Posted: Sun Sep 04, 2016 8:25 pm
by pe1chl
Numbers are only required when referring to existing items, i.e. only when modifying or deleting not when adding new items.

Re: Clarify "numbers" please!

Posted: Mon Sep 05, 2016 7:37 am
by borisk
@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

Re: Clarify "numbers" please!

Posted: Mon Sep 05, 2016 9:38 am
by janisk
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.

Re: Clarify "numbers" please!

Posted: Mon Sep 05, 2016 8:52 pm
by borisk
Ough my brain! Janisk, is there a way (especially for API queries) to exactly identify id of object I need to delete or modify?