from the command line I get a list with the first column # and then consecutive numbers for each lease. I don’t get that from the API, so I don’t know exactly what to send with the following command:
mikrotik.Send(“/ip/dhcp-server/lease/remove ”);
I have the following code looking up the entry by MAC address:
you are getting response of print command
and ‘where’ clause from CLI is not supproted by API, same as ‘find’
look here how that should be done in API http://wiki.mikrotik.com/wiki/API#Queries
UPDATE:
The following does give me an “!done” response, but does NOT delete the lease:
mikrotik.send(“/ip/dhcp-server/lease/remove “);
mikrotik.send(”?=mac-address=”, true);
Ok, I understand that “query words” need to be used. From the prompt, the only way to remove a lease is to use the generated number listed next to the print command. I used the following:
mikrotik.send(“/ip/dhcp-server/lease/remove “);
mikrotik.send(”?mac-address=”, true);
and I receive a “!trap=message=no such command”
Since the terminal gives me no option but an generated number next to each entry, how do I know what query to pass to this to remove the lease that I want to remove?
Robert
P.S. I thought the forum was supposed to email me when a reply was posted. That’s why I didn’t respond right away. Thanks for the help!