Open ivnandrade opened 7 years ago
Thanks for reporting! I'll try to fix as soon I have a bit of time for that!
Hi @ivnandrade,
please apologise for the so late answer, I'm just using the script against powerdns 4.0.4 and works properly with the ttl field into the rrsets. Can you tell me which pdns version you are using ?
Thanks!
When I try to create/change a record against powerdns4.0.0 api, for example A record, I receive this error:
{"error":."Key.'ttl'.not.an.Integer.or.not.present"}
That is becouse ttl field is sent into 'rrsets' field when It's supposed to be outside it, as seen here https://github.com/PowerDNS/pdns/issues/3492
Correct portion of code
payload = { "rrsets": [ { "name": self.args.name + '.' + self.args.zone, "type": self.args.recordType, "changetype": "REPLACE", "ttl": self.args.ttl, "records": [ { "content": self.args.content, "disabled": self.args.disabled, "name": self.args.name + '.' + self.args.zone, "set-ptr": self.args.setPTR, "type": self.args.recordType, "priority": self.args.priority } ] }
[...]
"rrsets": [ { "name": row[0] + '.' + row[1], "type": row[2], "changetype": "REPLACE", "ttl": row[5], "records": [ { "content": row[3], "disabled": disabled, "name": row[0] + '.' + row[1], "set-ptr": set_ptr, "type": row[2], "priority": row[7] } ] }