summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Coutinho <rodrigo.coutinho15@gmail.com>2017-11-28 14:45:02 -0200
committerRodrigo Coutinho <rodrigo.coutinho15@gmail.com>2017-11-28 14:45:02 -0200
commit21dd45783dc9fe7bdea4b2c5417f372d928ad716 (patch)
treed456cb2ab3a6aa1886be46e4c92e0df2450a8513
parentMerge pull request #7 from thehunmonkgroup/usage-examples (diff)
Configuration instructions on readme
-rw-r--r--README.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8243116..ca8c2df 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# PowerDNSex
-**TODO: Add description**
+A client to [PowerDNS 4 API](https://doc.powerdns.com/md/httpapi/README/), with all CRUD operations to manage zones and records.
## Installation
@@ -22,8 +22,18 @@ If [available in Hex](https://hex.pm/docs/publish), the package can be installed
end
```
+## Configuration with env vars
+Insert this in your Phoenix configuration files. Eg: `config.exs`
+```elixir
+config :powerdnsex, url: {:system, "POWERDNS_URL"},
+ token: {:system, "POWERDNS_TOKEN"}
+```
+Make sure you set those envinronment variables.
+
## Example usage
+### Zone Management
+
```elixir
# CREATE ZONE:
zone_model = %PowerDNSex.Models.Zone{
@@ -39,7 +49,12 @@ zone_model = %PowerDNSex.Models.Zone{
# DELETE ZONE:
res = PowerDNSex.delete_zone("example.com")
+```
+
+### Record management
+
+```elixir
# CREATE RECORD:
{:ok, zone} = PowerDNSex.show_zone("example.com")
record = %{
@@ -85,5 +100,4 @@ record = %{
}
rrset = PowerDNSex.show_record("example.com", record)
res = PowerDNSex.delete_record(zone, rrset)
-
```