pdns-client 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdns/client/version.rb +1 -1
- data/lib/pdns/client.rb +7 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: accae4e094e892cdd02f716b450fbf04aba9994ea94fdc74ae4da3bba15aea30
|
4
|
+
data.tar.gz: b340f3cf526a3d2ae918712732072d67d093ba301c63049fba22de145ec8cafc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac4daa116e91d48857ff499656b305184dd48a92d73b98b6d2be769688ca670373d0c4ff02018e6e6c11f3022c3a261dc158d78bfa25931239f8297be077176
|
7
|
+
data.tar.gz: 45e26292617a283887adee9f75c4444828e47b68e7bf48fe3f80973b04faaf9dacdb736aa66c61fbd0330907b92065d7f1f333735f6235a8de6b2bd691a474d5
|
data/lib/pdns/client/version.rb
CHANGED
data/lib/pdns/client.rb
CHANGED
@@ -70,12 +70,17 @@ module Pdns
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def upsert_record(zone_name, lvalue, type, rvalues, ttl = 60)
|
73
|
+
name = if lvalue.nil? || (lvalue == '')
|
74
|
+
"#{zone_name}."
|
75
|
+
else
|
76
|
+
"#{lvalue}.#{zone_name}."
|
77
|
+
end
|
73
78
|
rvalues = [rvalues].flatten
|
74
79
|
unwrap {
|
75
80
|
http.patch(@url + "api/v1/servers/localhost/zones/#{zone_name}", json: {
|
76
81
|
"rrsets": [
|
77
82
|
{
|
78
|
-
"name":
|
83
|
+
"name": name,
|
79
84
|
"type": type,
|
80
85
|
"ttl": ttl,
|
81
86
|
"changetype": "REPLACE",
|
@@ -83,7 +88,7 @@ module Pdns
|
|
83
88
|
{
|
84
89
|
"content": rvalue,
|
85
90
|
"disabled": false,
|
86
|
-
"name":
|
91
|
+
"name": name,
|
87
92
|
"type": type,
|
88
93
|
"priority": 0
|
89
94
|
}
|
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.
|
4
|
+
version: 0.3.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:
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -110,8 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
|
114
|
-
rubygems_version: 2.7.6
|
113
|
+
rubygems_version: 3.0.3
|
115
114
|
signing_key:
|
116
115
|
specification_version: 4
|
117
116
|
summary: DNS API Client
|