pdns icon indicating copy to clipboard operation
pdns copied to clipboard

Atomic replacement of zone contents using the API

Open jonathaneen opened this issue 5 years ago • 5 comments

  • Program: Authoritative
  • Issue type: Feature request

Short description

In the current functionality of the API of PowerDNS, it seems only possible to modify the contents of a zone by deleting or replacing RRSets in the zone. This way of editing a zone requires knowledge about the current state of the zone in PowerDNS, so a modification in the zone would always require two consecutive requests to the API. Please add functionality to replace the contents of a zone in a single, atomic request to the API. The functionality would be similar to 'load-zone' of pdnsutil.

Usecase

The most important value this feature would add for us, is that a complete zone change could be done in one atomic request. This minimizes the chance of race conditions and it emulates the behaviour of a database transaction in which an update is performed.

Description

I'm requesting the addition of a new endpoint to the API of PowerDNS, at which a complete zone with records and comments can be pushed in JSON format. The endpoint should then clear the current zone contents and replace the contents with the new zone contents (preferably in one database transaction). In case of a validation error or any other error, the zone modifications should be rolled back to the original state and the (validation) errors should be returned in the response. Changes in zone metadata are beyond the scope of this issue, it only focuses on changes in RRsets, Records and Comments.

jonathaneen avatar Jan 20 '20 08:01 jonathaneen

Would suggest doing this within the existing PUT code; but refactoring all the rrset update code to be reusable might be ... annoying :)

zeha avatar May 01 '20 22:05 zeha

Any updates on this ?

saiachyuth5 avatar Jun 03 '20 06:06 saiachyuth5

Any updates on this ?

No, sorry. Plenty of people that want this but none that have decided to type it in so far (which I get, it's quite a task).

Habbie avatar Jun 03 '20 07:06 Habbie

wait for updating

dearco avatar Jun 09 '20 06:06 dearco

For future ref and SEO foo magic: We'd like the equivalent of pdnsutil load-zone via the API

franklouwers avatar Jun 12 '20 11:06 franklouwers

I think this can closed, now with #12086 beeing merged.

klaus-nicat avatar Sep 21 '23 18:09 klaus-nicat