Skip to content

Add zone export to API and flarectl#385

Merged
patryk merged 2 commits intocloudflare:masterfrom
mfontani:add_zone_export
Nov 27, 2019
Merged

Add zone export to API and flarectl#385
patryk merged 2 commits intocloudflare:masterfrom
mfontani:add_zone_export

Conversation

@mfontani
Copy link
Copy Markdown

These two commits:

  • add a ZoneExport function to the API, which calls the proper API endpoint to return a textual BIND format dump of the given zone
  • add a "zone export" command to flarectl, which in turn uses the above ZoneExport API endpoint to dump the textual BIND format for the given zone to screen (or file, if input redirection is used).

Provide a general summary of your changes in the title above. You should
remove this overview, any sections and any section descriptions you
don't need below before submitting. There isn't a strict requirement to
use this template if you can structure your description and still cover
these points.

Has your change been tested?

Locally, with a few zones and using both supported syntaxes:

flarectl zone export --zone example.com
flarectl zone export example.com

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

... which implements the API endpoint described at:

    https://api.cloudflare.com/#dns-records-for-a-zone-export-dns-records

... and exports a given zone's configuration in textual BIND format.
i.e. allow the following (presuming the right env vars are set)
to export the textual BIND configuration for the zone:

    flarectl zone export --zone example.com > example.com.txt
@patryk
Copy link
Copy Markdown

patryk commented Nov 27, 2019

Thanks!

@patryk patryk merged commit b08349a into cloudflare:master Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants