Page 1 of 1

API 'find'

Posted: Fri Mar 21, 2008 7:40 pm
by cheesegrits
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

Re: API 'find'

Posted: Wed Mar 26, 2008 11:33 pm
by cheesegrits
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

Re: API 'find'

Posted: Thu Mar 27, 2008 4:04 pm
by tgrand
have you tryed the mac in quotes as a string?

Re: API 'find'

Posted: Fri May 09, 2008 10:25 pm
by cheesegrits
Yup.

-- hugh