Skip to content

Commit

Permalink
Added dns_records examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed May 17, 2016
1 parent 834509f commit 27ad0c1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def main():
{'name':'foo', 'type':'AAAA', 'content':'2001:d8b::1'},
{'name':'foo', 'type':'A', 'content':'192.168.0.1'},
{'name':'duh', 'type':'A', 'content':'10.0.0.1', 'ttl':120},
{'name':'bar', 'type':'CNAME', 'content':'foo.mahtin.net'},
{'name':'bar', 'type':'CNAME', 'content':'foo'},
{'name':'shakespeare', 'type':'TXT', 'content':"What's in a name? That which we call a rose by any other name ..."}
]

Expand Down Expand Up @@ -193,6 +193,30 @@ The output from the CLI command is in json format (and human readable).

### More complex CLI examples

```bash
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
{
"id": "94e028933c87b4bff3c70a42e6daac4f",
"name": "test.example.com",
"type": "A",
"content": "10.0.0.1",
...
}
$

$ cli4 /zones/:example.com/dns_records/:test.example.com | jq '{"id":.id,"name":.name,"type":.type,"content":.content}'
{
"id": "94e028933c87b4bff3c70a42e6daac4f",
"name": "test.example.com",
"type": "A",
"content": "10.0.0.1"
}

$ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
$
```

```bash
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
{"id":"d8afaec3dd2b7f8c1b470e594a21a01d"}
Expand Down
26 changes: 25 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ A DNS zone code example
{'name':'foo', 'type':'AAAA', 'content':'2001:d8b::1'},
{'name':'foo', 'type':'A', 'content':'192.168.0.1'},
{'name':'duh', 'type':'A', 'content':'10.0.0.1', 'ttl':120},
{'name':'bar', 'type':'CNAME', 'content':'foo.mahtin.net'},
{'name':'bar', 'type':'CNAME', 'content':'foo'},
{'name':'shakespeare', 'type':'TXT', 'content':"What's in a name? That which we call a rose by any other name ..."}
]
Expand Down Expand Up @@ -224,6 +224,30 @@ Simple CLI examples
More complex CLI examples
~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: bash
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
{
"id": "94e028933c87b4bff3c70a42e6daac4f",
"name": "test.example.com",
"type": "A",
"content": "10.0.0.1",
...
}
$
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq '{"id":.id,"name":.name,"type":.type,"content":.content}'
{
"id": "94e028933c87b4bff3c70a42e6daac4f",
"name": "test.example.com",
"type": "A",
"content": "10.0.0.1"
}
$ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
$
.. code:: bash
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='cloudflare',
version='1.0.4',
version='1.0.5',
description='Python wrapper for the CloudFlare v4 API',
long_description=long_description,
author='Martin J. Levy',
Expand Down

0 comments on commit 27ad0c1

Please sign in to comment.