[docs] Lua record usage with the API.
- Program: Authoritative
- Issue type: Bug report
Short description
I could not find Lua record usage description with the API explained in the documentation. I could figure out based on the generic SQL examples that the record type should be LUA instead of i.e. A and then the content should contain the record type, followed by the quoted script. However the record format in general is briefly explained, this is not straightforward. I would suggest to add this to the API docs here and here.
Environment
- Operating system: Alpine 3.12
- Software version: 4.2.2
- Software source: alpine package
@libesz were you able to figure out what the API wants here? I've tried sending in:
{
"name": "lua.exxampled.com",
"type": "LUA",
"ttl": 3600,
"changetype": "REPLACE",
"records": [{
"content": "A \\"\'1.2.3.4\'\\"",
"disabled": false
}]
}
And a bunch of other variants without any luck. I went into the DB backing my local pdns server and created the above record with SQL. When I query with dig it works as expected. When I list things in the API I get back:
{
"comments": [],
"name": "lua.exxampled.com.",
"records": [{
"content": "A \\"\'1.2.3.4\'\\"",
"disabled": false
}],
"ttl": 3600,
"type": "LUA"
}
which seems to match up afaict.
No matter what I do I end up getting a 422:
422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8081/api/v1/servers/localhost/zones/exxampled.com.
/cc https://github.com/octodns/octodns-powerdns/issues/7
I've tried the other way around, by creating a Lua record through an open-source solution like Poweradmin, then tried fetching the records using their API.
Unfortunately, the API responds with 500 Internal Server Error. @ross Did you manage to get it to work?
Unfortunately, the API responds with
500 Internal Server Error. @ross Did you manage to get it to work?
What does the server log report in this case?
Unfortunately, the API responds with
500 Internal Server Error. @ross Did you manage to get it to work?
It's been long enough that I don't really remember. I definitely wasn't hitting 500 errors though. My end conclusion was that the lua support in API wasn't particularly polished. Wonder if Poweradmin is using it. If so maybe it's worth looking at what it's doing.
Unfortunately, the API responds with
500 Internal Server Error. @ross Did you manage to get it to work?What does the server log report in this case?
Hello @zeha, I wasn't able to inspect the response body when I was trying. Will have to get back to you on that next week.