forked from cloudflare/python-cloudflare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for dns_records/import and file upload via library and cli4 c…
…ommand
- Loading branch information
Showing
5 changed files
with
109 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -461,6 +461,8 @@ For example: | |
cli4 --put ="00000000000000000000000000000000" /user/load_balancers/maps/:00000000000000000000000000000000/region/:WNAM | ||
``` | ||
|
||
Data can also be uploaded from file contents. Using the ```item=@filename``` format will open the file and the contents uploaded in the POST. | ||
|
||
### CLI output | ||
|
||
The output from the CLI command is in JSON or YAML format (and human readable). This is controled by the **--yaml** or **--json** flags (JSON is the default). | ||
|
@@ -620,6 +622,34 @@ $ cli4 /zones/:example.com/dnssec | |
$ | ||
``` | ||
|
||
### Zone file upload CLI examples | ||
|
||
Refer to [Import DNS records](https://api.cloudflare.com/#dns-records-for-a-zone-import-dns-records) on API documentation for this feature. | ||
|
||
```bash | ||
$ cat zone.txt | ||
example.com. IN SOA somewhere.example.com. someone.example.com. ( | ||
2017010101 | ||
3H | ||
15 | ||
1w | ||
3h | ||
) | ||
|
||
record1.example.com. IN A 10.0.0.1 | ||
record2.example.com. IN AAAA 2001:d8b::2 | ||
record3.example.com. IN CNAME record1.example.com. | ||
record4.example.com. IN TXT "some text" | ||
$ | ||
|
||
$ cli4 --post [email protected] /zones/:example.txt/dns_records/import | ||
{ | ||
"recs_added": 4, | ||
"total_records_parsed": 4 | ||
} | ||
$ | ||
``` | ||
|
||
## Implemented API calls | ||
|
||
The **--dump** argument to cli4 will produce a list of all the call implemented within the library. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,6 +514,10 @@ For example: | |
|
||
cli4 --put ="00000000000000000000000000000000" /user/load_balancers/maps/:00000000000000000000000000000000/region/:WNAM | ||
|
||
Data can also be uploaded from file contents. Using the | ||
``item=@filename`` format will open the file and the contents uploaded | ||
in the POST. | ||
|
||
CLI output | ||
~~~~~~~~~~ | ||
|
||
|
@@ -681,6 +685,37 @@ DNSSEC CLI examples | |
} | ||
$ | ||
Zone file upload CLI examples | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Refer to `Import DNS | ||
records <https://api.cloudflare.com/#dns-records-for-a-zone-import-dns-records>`__ | ||
on API documentation for this feature. | ||
|
||
.. code:: bash | ||
$ cat zone.txt | ||
example.com. IN SOA somewhere.example.com. someone.example.com. ( | ||
2017010101 | ||
3H | ||
15 | ||
1w | ||
3h | ||
) | ||
record1.example.com. IN A 10.0.0.1 | ||
record2.example.com. IN AAAA 2001:d8b::2 | ||
record3.example.com. IN CNAME record1.example.com. | ||
record4.example.com. IN TXT "some text" | ||
$ | ||
$ cli4 --post [email protected] /zones/:example.txt/dns_records/import | ||
{ | ||
"recs_added": 4, | ||
"total_records_parsed": 4 | ||
} | ||
$ | ||
Implemented API calls | ||
--------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters