pdns_api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdns_api/api.rb +20 -10
- data/lib/pdns_api/client.rb +4 -0
- data/lib/pdns_api/config.rb +5 -1
- data/lib/pdns_api/cryptokey.rb +4 -8
- data/lib/pdns_api/http.rb +1 -1
- data/lib/pdns_api/metadata.rb +1 -1
- data/lib/pdns_api/override.rb +0 -8
- data/lib/pdns_api/version.rb +1 -1
- data/lib/pdns_api/zone.rb +0 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa80cf3197ec8aadd0d2a93cf3cf0a1df581034c
|
4
|
+
data.tar.gz: 5c0e8f49631af8097165db914a239cc527033992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 533c9908e0d64d37594c683476009952606007ed065f5ff06f4ced79199eb5bb1bf88f739ad487982f6d9adb6eaabbe30654bff5e7378492f94ea2ed15f4e5c6
|
7
|
+
data.tar.gz: 52f239530706b483f0b21b55fc8c014a0e84c609ff0b51cd0dfda9403bc51d3b403123358c0ef858f62339a84edaa62b3eb6e993fd1ee7a1b026e2831e66e745
|
data/lib/pdns_api/api.rb
CHANGED
@@ -32,10 +32,21 @@ module PDNS
|
|
32
32
|
attr_reader :class
|
33
33
|
|
34
34
|
##
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
38
|
-
|
35
|
+
# Changes this object's information on the server.
|
36
|
+
#
|
37
|
+
# +rrsets+ is used as changeset for the update.
|
38
|
+
def change(rrsets)
|
39
|
+
@http.put(@url, rrsets)
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Creates this object on the server
|
44
|
+
#
|
45
|
+
# If +info+ is set this method updates the current information.
|
46
|
+
# The current information is used to create the object.
|
47
|
+
def create(info = nil)
|
48
|
+
info(info)
|
49
|
+
@http.post("#{@parent.url}/#{@class}", @info)
|
39
50
|
end
|
40
51
|
|
41
52
|
##
|
@@ -45,10 +56,10 @@ module PDNS
|
|
45
56
|
end
|
46
57
|
|
47
58
|
##
|
48
|
-
#
|
49
|
-
|
50
|
-
|
51
|
-
@http.
|
59
|
+
# Gets the information of this object from the API and use it
|
60
|
+
# to update the object's information.
|
61
|
+
def get
|
62
|
+
@info = @http.get @url
|
52
63
|
end
|
53
64
|
|
54
65
|
##
|
@@ -56,7 +67,6 @@ module PDNS
|
|
56
67
|
# This does not cause an API request.
|
57
68
|
#
|
58
69
|
# If +info+ is set this method updates the current information.
|
59
|
-
#
|
60
70
|
def info(info = nil)
|
61
71
|
return @info if info.nil?
|
62
72
|
|
@@ -65,7 +75,7 @@ module PDNS
|
|
65
75
|
|
66
76
|
##
|
67
77
|
# Ensures the object is an array.
|
68
|
-
# If it is not, an array containing the item is returned
|
78
|
+
# If it is not, an array containing the item is returned.
|
69
79
|
def ensure_array(item)
|
70
80
|
return item if item.is_a? Array
|
71
81
|
[item]
|
data/lib/pdns_api/client.rb
CHANGED
data/lib/pdns_api/config.rb
CHANGED
@@ -29,6 +29,10 @@ module PDNS
|
|
29
29
|
# The value of the configuration option.
|
30
30
|
attr_accessor :value
|
31
31
|
|
32
|
+
##
|
33
|
+
# Disabled common methods
|
34
|
+
undef_method :delete
|
35
|
+
|
32
36
|
##
|
33
37
|
# Creates a configuration option object.
|
34
38
|
#
|
@@ -42,7 +46,7 @@ module PDNS
|
|
42
46
|
@parent = parent
|
43
47
|
@name = name
|
44
48
|
@url = "#{parent.url}/#{@class}/#{name}"
|
45
|
-
@value =
|
49
|
+
@value = get if value.nil?
|
46
50
|
value(@value)
|
47
51
|
end
|
48
52
|
|
data/lib/pdns_api/cryptokey.rb
CHANGED
@@ -21,6 +21,10 @@ module PDNS
|
|
21
21
|
##
|
22
22
|
# Cryptokey for a zone.
|
23
23
|
class CryptoKey < API
|
24
|
+
##
|
25
|
+
# The ID of the cryptokey.
|
26
|
+
attr_reader :id
|
27
|
+
|
24
28
|
##
|
25
29
|
# Creates a cryptokey object.
|
26
30
|
#
|
@@ -36,13 +40,5 @@ module PDNS
|
|
36
40
|
@info = info
|
37
41
|
@url = "#{parent.url}/#{@class}/#{id}"
|
38
42
|
end
|
39
|
-
|
40
|
-
##
|
41
|
-
# Changes cryptokey information
|
42
|
-
#
|
43
|
-
# +rrset+ is used as changeset for the update.
|
44
|
-
def change(rrsets)
|
45
|
-
@http.put(@url, rrsets)
|
46
|
-
end
|
47
43
|
end
|
48
44
|
end
|
data/lib/pdns_api/http.rb
CHANGED
data/lib/pdns_api/metadata.rb
CHANGED
data/lib/pdns_api/override.rb
CHANGED
data/lib/pdns_api/version.rb
CHANGED
data/lib/pdns_api/zone.rb
CHANGED
@@ -56,13 +56,6 @@ module PDNS
|
|
56
56
|
@http.patch(@url, rrsets: rrsets)
|
57
57
|
end
|
58
58
|
|
59
|
-
##
|
60
|
-
# Modifies basic zone data (metadata).
|
61
|
-
# +rrset+ is used as changeset for the update.
|
62
|
-
def change(rrsets)
|
63
|
-
@http.put(@url, rrsets)
|
64
|
-
end
|
65
|
-
|
66
59
|
##
|
67
60
|
# Notifies slaves for a zone.
|
68
61
|
# Only works for domains for which the server is a master.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdns_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Silke Hofstra
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2016-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A gem for manipulation of DNS through the PowerDNS API
|
14
|
-
email: silke@slxh.
|
14
|
+
email: silke.ruby@slxh.nl
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
@@ -39,7 +39,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
39
39
|
requirements:
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: 1.9.1
|
43
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
version: '0'
|
48
48
|
requirements: []
|
49
49
|
rubyforge_project:
|
50
|
-
rubygems_version: 2.
|
50
|
+
rubygems_version: 2.2.2
|
51
51
|
signing_key:
|
52
52
|
specification_version: 4
|
53
53
|
summary: PowerDNS API gem
|