Skip to content

Commit 636658d

Browse files
committed
Added documentation for DNS CLI commands and upped version to 1.0.6
1 parent ec9fef2 commit 636658d

4 files changed

Lines changed: 35 additions & 5 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ The output from the CLI command is in json format (and human readable).
193193

194194
### More complex CLI examples
195195

196+
Here is the creation of a DNS entry, followed by a listing of that entry and then the deletion of that entry.
197+
196198
```bash
197199
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
198200
{
@@ -217,6 +219,17 @@ $ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
217219
$
218220
```
219221

222+
There's the ability to handle dns entries with multiple values. This produces more than one API call within the command.
223+
224+
```
225+
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq -c '.[]|{"id":.id,"name":.name,"type":.type,"content":.content}'
226+
{"id":"bca0c4a5e3691e62841627e4dc3a19ed","name":"test.example.com","type":"A","content":"192.168.0.1"}
227+
{"id":"d94f788e6bf72ba2a54145ad04b34f08","name":"test.example.com","type":"AAAA","content":"2001:d8b::1"}
228+
$
229+
```
230+
231+
Here are the cache purging commands.
232+
220233
```bash
221234
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
222235
{"id":"d8afaec3dd2b7f8c1b470e594a21a01d"}
@@ -235,6 +248,8 @@ cli4: /zones/:example.com/purge_cache - 1107 Only enterprise zones can purge by
235248
$
236249
```
237250
251+
A somewhat useful listing of available plans for a specific zone.
252+
238253
```bash
239254
$ cli4 /zones/:example.com/available_plans | jq -c '.[]|{"id":.id,"name":.name}'
240255
{"id":"a577b510288e82b26486fd1df47000ec","name":"Pro Website"}

README.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ Simple CLI examples
224224
More complex CLI examples
225225
~~~~~~~~~~~~~~~~~~~~~~~~~
226226

227+
Here is the creation of a DNS entry, followed by a listing of that entry
228+
and then the deletion of that entry.
229+
227230
.. code:: bash
228231
229232
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
@@ -248,6 +251,18 @@ More complex CLI examples
248251
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
249252
$
250253
254+
There's the ability to handle dns entries with multiple values. This
255+
produces more than one API call within the command.
256+
257+
::
258+
259+
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq -c '.[]|{"id":.id,"name":.name,"type":.type,"content":.content}'
260+
{"id":"bca0c4a5e3691e62841627e4dc3a19ed","name":"test.example.com","type":"A","content":"192.168.0.1"}
261+
{"id":"d94f788e6bf72ba2a54145ad04b34f08","name":"test.example.com","type":"AAAA","content":"2001:d8b::1"}
262+
$
263+
264+
Here are the cache purging commands.
265+
251266
.. code:: bash
252267
253268
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
@@ -266,6 +281,8 @@ More complex CLI examples
266281
cli4: /zones/:example.com/purge_cache - 1107 Only enterprise zones can purge by tag.
267282
$
268283
284+
A somewhat useful listing of available plans for a specific zone.
285+
269286
.. code:: bash
270287
271288
$ cli4 /zones/:example.com/available_plans | jq -c '.[]|{"id":.id,"name":.name}'

cli4/cli4.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ def cli4(args):
229229

230230
results = []
231231
for i2 in identifier2:
232-
print 'RUNNING:', '/' + '/'.join(cmd), '-', i2
233-
234232
try:
235233
if method is 'GET':
236234
r = m.get(identifier1 = identifier1, identifier2 = i2, params = params)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
setup(
1010
name='cloudflare',
11-
version='1.0.5',
11+
version='1.0.6',
1212
description='Python wrapper for the CloudFlare v4 API',
1313
long_description=long_description,
1414
author='Martin J. Levy',
1515
author_email='martin@cloudflare.com',
16-
maintainer='Martin J. Levy',
17-
maintainer_email='mahtin@mahtin.com',
16+
# maintainer='Martin J. Levy',
17+
# maintainer_email='mahtin@mahtin.com',
1818
url='https://github.com/cloudflare/python-cloudflare',
1919
license='MIT',
2020
packages=['cli4']+find_packages(),

0 commit comments

Comments
 (0)