Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - krizzo

#1
24.7, 24.10 Series / Re: Adding reservations with Kea API?
September 10, 2024, 04:27:08 PM
Quote from: doktornotor on September 09, 2024, 08:58:00 PM
Well, admittedly I never tried any API stuff with Kea, but 200 sounds like "it worked", not "failed".

200 might just mean it received the request and the API didn't know how to process the data so it reported back that it failed to create the reservation. When I look in the UI I don't see the reservation that it should create from the API request. I'm wondering if the data structure is missing something.
#2
24.7, 24.10 Series / Adding reservations with Kea API?
September 09, 2024, 08:28:46 PM
I am trying to add a bunch of DHCP reservations in Kea and wanted to use the API. I've generated a key/secret for the user and can query the service status just fine at /api/kea/service/status

I tried multiple ways to post some json to the API for adding the reservations but with no luck. I keep getting a status 200 result failed message. The simple curl I've tried to add one reservation is below. What am I doing wrong?


curl -k --header "Content-Type: application/json" \
 --request POST \
 -d '{"description": "DEVICE", "hostname": "device-001", "hw_address": "01:23:45:67:89:ab", "subnet": "192.168.0.0/24", "ip_address": "192.168.0.10"}' \
 -u "key":"secret" \
 https://192.168.0.1/api/kea/dhcpv4/addReservation