summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Coutinho <digao@osfeio.com>2017-11-30 17:46:47 -0200
committerGitHub <noreply@github.com>2017-11-30 17:46:47 -0200
commit462d38c4a9d291fe3b00d34d66cfb0b1514715c1 (patch)
tree2bb3bb5723d2caf2bdc4a58feaf3556ff1f76d01
parentMerge pull request #6 from thehunmonkgroup/master (diff)
parentImprove readme (diff)
Merge pull request #8 from digaoddc/readme
Configuration instructions on readme
-rw-r--r--README.md26
1 files changed, 24 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8243116..6489221 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,25 @@ If [available in Hex](https://hex.pm/docs/publish), the package can be installed
end
```
+## Configuration
+Insert this in your configuration files. Eg: `config.exs`
+
+```elixir
+config :powerdnsex, url: "localhost:8081",
+ token: "sometoken"
+```
+
+You can also use ENV vars to configure PowerDNSex.
+```elixir
+config :powerdnsex, url: {:system, "POWERDNS_URL"},
+ token: {:system, "POWERDNS_TOKEN"}
+```
+Make sure you set those environment variables.
+
## Example usage
+### Zone Management
+
```elixir
# CREATE ZONE:
zone_model = %PowerDNSex.Models.Zone{
@@ -39,7 +56,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 +107,5 @@ record = %{
}
rrset = PowerDNSex.show_record("example.com", record)
res = PowerDNSex.delete_record(zone, rrset)
-
```
+