]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API docs: add multi-record update example 2376/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Wed, 25 Mar 2015 13:28:53 +0000 (14:28 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Wed, 25 Mar 2015 13:28:53 +0000 (14:28 +0100)
And remove priority from the examples.

docs/markdown/httpapi/README.md

index e8e1b314567f244b0da407b38288bbf0d4f48ae9..63647f92e4ec36f8695464b5721c71dc1a23fccf 100644 (file)
@@ -39,7 +39,21 @@ After restarting `pdns_server`, the following examples should start working:
     curl -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .
     
     # Add a new record to the new zone (would replace any existing test.example.org/A records)
-    curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org", "type": "A", "changetype": "REPLACE", "records": [ {"content": "1.1.1.1", "disabled": false, "name": "test.example.org", "ttl": 86400, "type": "A", "priority": 0 } ] } ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .
+    curl -X PATCH --data '{"rrsets": [ {"name": "test.example.org", "type": "A", "changetype": "REPLACE", "records": [ {"content": "192.0.5.4", "disabled": false, "name": "test.example.org", "ttl": 86400, "type": "A" } ] } ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .
+
+    # Combined replacement of multiple RRsets
+    curl -X PATCH --data '{"rrsets": [
+      {"name": "test1.example.org",
+       "type": "A",
+       "changetype": "REPLACE",
+       "records": [ {"content": "192.0.2.5", "disabled": false, "name": "test.example.org", "ttl": 86400, "type": "A" } ]
+      },
+      {"name": "test2.example.org",
+       "type": "AAAA",
+       "changetype": "REPLACE",
+       "records": [ {"content": "2001:db8::6/32", "disabled": false, "name": "test.example.org", "ttl": 86400, "type": "AAAA" } ]
+      }
+      ] }' -H 'X-API-Key: changeme' http://127.0.0.1:8081/servers/localhost/zones/example.org | jq .
 
 `jq` is a highly recommended tool for pretty-printing JSON. If you don't have
 `jq`, try `json_pp` or `python -mjson.tool` instead.