[Kea-users] Need help in MySQL queries - KEA

Klaus Steden klausfiend at gmail.com
Tue Dec 27 10:14:33 UTC 2016


This should all be possible with standard SQL queries, e.g.,

1. select hex(hwaddr), subnet_id, inet_ntoa(address), expire from lease4
where <condition>;
2. select hex(hwaddr), subnet_id, inet_ntoa(address), expire from hosts
where <condition>;
3. you should probably let Kea insert new lease information for you, since
that's what it's supposed to do
4. see #3

This is all pretty much covered in the documentation. see
http://kea.isc.org/wiki/HostReservationsHowTo,
http://kea.isc.org/docs/kea-guide.html#idp49015504 etc.

Your API just needs to understand standard SQL syntax in order to insert
reservations and/or query existing lease information.

cheers,
Klaus

On Mon, Dec 26, 2016 at 11:47 PM, Nandan Adhikari <
nandan.adhikari007 at gmail.com> wrote:

> Hi,
>
> I am writing a service which assigns IP addresses to newly provisioned VMs
> or physical machines from a pre-defined IP pool. I want to use KEA with
> Galera MySQL backend. The problem I am facing is that there is no docs/info
> regarding the Table schema details or SQL queries to do common tasks like:
>
> 1) lease lookup by mac/ip
> 2) reservation lookup by mac/ip
> 3) add new lease
> 4) delete an existing lease
>
> Here is what I am thinking for above APIs:
>
> 1) lease lookup by mac: (SELECT INET_NTOA(address) as address, HEX(hwaddr)
> as hwaddr, hostname from lease4 where HEX(hwaddr)= ?", macid)
>
> If you could advice me on how to write such API's to do basic management.
>
> --
> Thanks & warm wishes,
> Nandan Adhikari
>
> _______________________________________________
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20161227/b15e5402/attachment.htm>


More information about the Kea-users mailing list