Skip to content

Commit

Permalink
Added documentation for DNS CLI commands and upped version to 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed May 18, 2016
1 parent ec9fef2 commit 636658d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ The output from the CLI command is in json format (and human readable).

### More complex CLI examples

Here is the creation of a DNS entry, followed by a listing of that entry and then the deletion of that entry.

```bash
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
{
Expand All @@ -217,6 +219,17 @@ $ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
$
```

There's the ability to handle dns entries with multiple values. This produces more than one API call within the command.

```
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq -c '.[]|{"id":.id,"name":.name,"type":.type,"content":.content}'
{"id":"bca0c4a5e3691e62841627e4dc3a19ed","name":"test.example.com","type":"A","content":"192.168.0.1"}
{"id":"d94f788e6bf72ba2a54145ad04b34f08","name":"test.example.com","type":"AAAA","content":"2001:d8b::1"}
$
```

Here are the cache purging commands.

```bash
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
{"id":"d8afaec3dd2b7f8c1b470e594a21a01d"}
Expand All @@ -235,6 +248,8 @@ cli4: /zones/:example.com/purge_cache - 1107 Only enterprise zones can purge by
$
```
A somewhat useful listing of available plans for a specific zone.
```bash
$ cli4 /zones/:example.com/available_plans | jq -c '.[]|{"id":.id,"name":.name}'
{"id":"a577b510288e82b26486fd1df47000ec","name":"Pro Website"}
Expand Down
17 changes: 17 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ Simple CLI examples
More complex CLI examples
~~~~~~~~~~~~~~~~~~~~~~~~~

Here is the creation of a DNS entry, followed by a listing of that entry
and then the deletion of that entry.

.. code:: bash
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
Expand All @@ -248,6 +251,18 @@ More complex CLI examples
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
$
There's the ability to handle dns entries with multiple values. This
produces more than one API call within the command.

::

$ cli4 /zones/:example.com/dns_records/:test.example.com | jq -c '.[]|{"id":.id,"name":.name,"type":.type,"content":.content}'
{"id":"bca0c4a5e3691e62841627e4dc3a19ed","name":"test.example.com","type":"A","content":"192.168.0.1"}
{"id":"d94f788e6bf72ba2a54145ad04b34f08","name":"test.example.com","type":"AAAA","content":"2001:d8b::1"}
$

Here are the cache purging commands.

.. code:: bash
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
Expand All @@ -266,6 +281,8 @@ More complex CLI examples
cli4: /zones/:example.com/purge_cache - 1107 Only enterprise zones can purge by tag.
$
A somewhat useful listing of available plans for a specific zone.
.. code:: bash
$ cli4 /zones/:example.com/available_plans | jq -c '.[]|{"id":.id,"name":.name}'
Expand Down
2 changes: 0 additions & 2 deletions cli4/cli4.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ def cli4(args):

results = []
for i2 in identifier2:
print 'RUNNING:', '/' + '/'.join(cmd), '-', i2

try:
if method is 'GET':
r = m.get(identifier1 = identifier1, identifier2 = i2, params = params)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

setup(
name='cloudflare',
version='1.0.5',
version='1.0.6',
description='Python wrapper for the CloudFlare v4 API',
long_description=long_description,
author='Martin J. Levy',
author_email='martin@cloudflare.com',
maintainer='Martin J. Levy',
maintainer_email='mahtin@mahtin.com',
# maintainer='Martin J. Levy',
# maintainer_email='mahtin@mahtin.com',
url='https://github.com/cloudflare/python-cloudflare',
license='MIT',
packages=['cli4']+find_packages(),
Expand Down

0 comments on commit 636658d

Please sign in to comment.