Community discussions

MikroTik App
 
cheesegrits
just joined
Topic Author
Posts: 16
Joined: Fri Jun 01, 2007 11:17 pm

API 'find'

Fri Mar 21, 2008 7:40 pm

I'm testing my new perl API client. Most stuff seems to work fine, but I'm having problems with the 'find' command. In the console, if I want to find (say) a wireless-access entry with a given MAC, I can do this:

[admin@foo] /interface wireless access-list> :put [find mac-address="00:02:6F:56:78:9A"]
*a

Which I would have thought would translate to this in the API:

/interface/wireless/access-list/find
=mac-address=00:12:34:56:78:9A

... but if I try that, I get back an "argument error" ...

!trap
=message=argument error

Any ideas?

-- hugh
 
cheesegrits
just joined
Topic Author
Posts: 16
Joined: Fri Jun 01, 2007 11:17 pm

Re: API 'find'

Wed Mar 26, 2008 11:33 pm

Any takers?

Here's an example of the problem. I'm writing some provisioning code to add, remove and authorize wireless ACL's. Obviously my "primary key" is the MAC address of the radio. But the 'set' command requires the Mtik internal '.id'.

So what I'd like to be able to do is a quick call to the API which finds the .id based on MAC, as per my previous post.

As I can't work out how to do this, what I'm having to do at the moment is fetch the entire ACL list and pick the bones out of that to get the one .id I need.

Not a huge deal, but it does make for quite a lot of extra API traffic.

-- hugh
 
User avatar
tgrand
Long time Member
Long time Member
Posts: 667
Joined: Mon Aug 21, 2006 2:57 am
Location: Winnipeg, Manitoba, Canada

Re: API 'find'

Thu Mar 27, 2008 4:04 pm

have you tryed the mac in quotes as a string?
 
cheesegrits
just joined
Topic Author
Posts: 16
Joined: Fri Jun 01, 2007 11:17 pm

Re: API 'find'

Fri May 09, 2008 10:25 pm

Yup.

-- hugh

Who is online

Users browsing this forum: No registered users and 9 guests