Skip to content

Commit 27ad0c1

Browse files
committed
Added dns_records examples
1 parent 834509f commit 27ad0c1

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def main():
153153
{'name':'foo', 'type':'AAAA', 'content':'2001:d8b::1'},
154154
{'name':'foo', 'type':'A', 'content':'192.168.0.1'},
155155
{'name':'duh', 'type':'A', 'content':'10.0.0.1', 'ttl':120},
156-
{'name':'bar', 'type':'CNAME', 'content':'foo.mahtin.net'},
156+
{'name':'bar', 'type':'CNAME', 'content':'foo'},
157157
{'name':'shakespeare', 'type':'TXT', 'content':"What's in a name? That which we call a rose by any other name ..."}
158158
]
159159

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

194194
### More complex CLI examples
195195

196+
```bash
197+
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
198+
{
199+
"id": "94e028933c87b4bff3c70a42e6daac4f",
200+
"name": "test.example.com",
201+
"type": "A",
202+
"content": "10.0.0.1",
203+
...
204+
}
205+
$
206+
207+
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq '{"id":.id,"name":.name,"type":.type,"content":.content}'
208+
{
209+
"id": "94e028933c87b4bff3c70a42e6daac4f",
210+
"name": "test.example.com",
211+
"type": "A",
212+
"content": "10.0.0.1"
213+
}
214+
215+
$ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
216+
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
217+
$
218+
```
219+
196220
```bash
197221
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .
198222
{"id":"d8afaec3dd2b7f8c1b470e594a21a01d"}

README.rst

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ A DNS zone code example
180180
{'name':'foo', 'type':'AAAA', 'content':'2001:d8b::1'},
181181
{'name':'foo', 'type':'A', 'content':'192.168.0.1'},
182182
{'name':'duh', 'type':'A', 'content':'10.0.0.1', 'ttl':120},
183-
{'name':'bar', 'type':'CNAME', 'content':'foo.mahtin.net'},
183+
{'name':'bar', 'type':'CNAME', 'content':'foo'},
184184
{'name':'shakespeare', 'type':'TXT', 'content':"What's in a name? That which we call a rose by any other name ..."}
185185
]
186186
@@ -224,6 +224,30 @@ Simple CLI examples
224224
More complex CLI examples
225225
~~~~~~~~~~~~~~~~~~~~~~~~~
226226

227+
.. code:: bash
228+
229+
$ $ cli4 --post name="test" type="A" content="10.0.0.1" /zones/:example.com/dns_records
230+
{
231+
"id": "94e028933c87b4bff3c70a42e6daac4f",
232+
"name": "test.example.com",
233+
"type": "A",
234+
"content": "10.0.0.1",
235+
...
236+
}
237+
$
238+
239+
$ cli4 /zones/:example.com/dns_records/:test.example.com | jq '{"id":.id,"name":.name,"type":.type,"content":.content}'
240+
{
241+
"id": "94e028933c87b4bff3c70a42e6daac4f",
242+
"name": "test.example.com",
243+
"type": "A",
244+
"content": "10.0.0.1"
245+
}
246+
247+
$ cli4 --delete /zones/:example.com/dns_records/:test.example.com | jq -c .
248+
{"id":"94e028933c87b4bff3c70a42e6daac4f"}
249+
$
250+
227251
.. code:: bash
228252
229253
$ cli4 --delete purge_everything=true /zones/:example.com/purge_cache | jq -c .

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='cloudflare',
11-
version='1.0.4',
11+
version='1.0.5',
1212
description='Python wrapper for the CloudFlare v4 API',
1313
long_description=long_description,
1414
author='Martin J. Levy',

0 commit comments

Comments
 (0)