pdns-client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100b3241c08e1c760231a4a2bfb746ae01edefbe7702c2a89c74ef543cf23ee8
4
- data.tar.gz: 2b7babd54f1696f95eea60aa54b48a484dbdead5b02b8ab6723b06a5191bd2cf
3
+ metadata.gz: 4ebba94e761d2a3e111ce4112dd909b07f27ca8f584000577fcb94df1b82afce
4
+ data.tar.gz: be876ff6db52cfede08c8327b3c6f030297039e6231154a93e0596a2042bdf87
5
5
  SHA512:
6
- metadata.gz: be825ef227acd339f702b271e09785eee5fb7c8e040cb708800711cb9ddea00f72f2d111120df1f87a9cbd1666dcca3f7c3f9b4bf2cd80d5ccf2d1e70caf6df2
7
- data.tar.gz: f97e28a07bc5057a5d4d94a8b78aafa807c8d96b71f2215f582e08e02a763f6854b3672dabb7fbaf16e9f6bd143fb209acc38f358d2614fc97229200c2e811e6
6
+ metadata.gz: bad3ddfef2fdd3ec686225c295e87b6c025907b2fa05f0585493fa9f65d5df1563c1e784b882cd088078eaf3905c1110e399e74080cedb878acb35720e09887a
7
+ data.tar.gz: 5fb34d4696ad9142cad80854f057b63f98cc92bf27ee5b2821e8b9dd8429818b30636e1bbc9fffac7e9f608ea3fb75a335cb834f69eb09846038edd93ae2ddfc
data/lib/pdns/client.rb CHANGED
@@ -69,7 +69,8 @@ module Pdns
69
69
  {"records" => dapi_compatible}
70
70
  end
71
71
 
72
- def upsert_record(zone_name, lvalue, type, rvalue, ttl = 60)
72
+ def upsert_record(zone_name, lvalue, type, rvalues, ttl = 60)
73
+ rvalues = [rvalues].flatten
73
74
  unwrap {
74
75
  http.patch(@url + "api/v1/servers/localhost/zones/#{zone_name}", json: {
75
76
  "rrsets": [
@@ -78,7 +79,7 @@ module Pdns
78
79
  "type": type,
79
80
  "ttl": ttl,
80
81
  "changetype": "REPLACE",
81
- "records": [
82
+ "records": rvalues.map do |rvalue|
82
83
  {
83
84
  "content": rvalue,
84
85
  "disabled": false,
@@ -86,7 +87,7 @@ module Pdns
86
87
  "type": type,
87
88
  "priority": 0
88
89
  }
89
- ]
90
+ end
90
91
  }
91
92
  ]
92
93
  })
@@ -1,5 +1,5 @@
1
1
  module Pdns
2
2
  class Client
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdns-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Hearn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-18 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http