Skip to content

Commit

Permalink
added dns_records/export documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Aug 27, 2017
1 parent 9a35d4f commit 434efb8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ $ cli4 /zones/:example.com/dnssec
$
```

### Zone file upload CLI examples
### Zone file upload and download CLI examples (uses BIND format files)

Refer to [Import DNS records](https://api.cloudflare.com/#dns-records-for-a-zone-import-dns-records) on API documentation for this feature.

Expand Down Expand Up @@ -650,6 +650,27 @@ $ cli4 --post file=@zone.txt /zones/:example.com/dns_records/import
$
```

The following is documented within the **Advanced** option of the DNS page within the Cloudflare portal.

```
$ python -m cli4 /zones/:example.com/dns_records/export | jq -r . | egrep -v '^;;|^$'
$ORIGIN .
@ 3600 IN SOA example.com. root.example.com. (
2025552311 ; serial
7200 ; refresh
3600 ; retry
86400 ; expire
3600) ; minimum
example.com. 300 IN NS REPLACE&ME$WITH^YOUR@NAMESERVER.
record4.example.com. 300 IN TXT "some text"
record3.example.com. 300 IN CNAME record1.example.com.
record1.example.com. 300 IN A 10.0.0.1
record2.example.com. 300 IN AAAA 2001:d8b::2
$
```

The **jq -r** option is used to convert newlines and tabs within the JSON response data. The egrep is used for documentation brevity.

## Implemented API calls

The **--dump** argument to cli4 will produce a list of all the call implemented within the library.
Expand Down
27 changes: 25 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,8 @@ DNSSEC CLI examples
}
$
Zone file upload CLI examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Zone file upload and download CLI examples (uses BIND format files)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Refer to `Import DNS
records <https://api.cloudflare.com/#dns-records-for-a-zone-import-dns-records>`__
Expand Down Expand Up @@ -716,6 +716,29 @@ on API documentation for this feature.
}
$
The following is documented within the **Advanced** option of the DNS
page within the Cloudflare portal.

::

$ python -m cli4 /zones/:example.com/dns_records/export | jq -r . | egrep -v '^;;|^$'
$ORIGIN .
@ 3600 IN SOA example.com. root.example.com. (
2025552311 ; serial
7200 ; refresh
3600 ; retry
86400 ; expire
3600) ; minimum
example.com. 300 IN NS REPLACE&ME$WITH^YOUR@NAMESERVER.
record4.example.com. 300 IN TXT "some text"
record3.example.com. 300 IN CNAME record1.example.com.
record1.example.com. 300 IN A 10.0.0.1
record2.example.com. 300 IN AAAA 2001:d8b::2
$

The **jq -r** option is used to convert newlines and tabs within the
JSON response data. The egrep is used for documentation brevity.

Implemented API calls
---------------------

Expand Down

0 comments on commit 434efb8

Please sign in to comment.