fog-dnsimple 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +17 -3
- data/Gemfile +9 -2
- data/LICENSE.txt +22 -0
- data/README.md +29 -26
- data/lib/fog/bin/dnsimple.rb +42 -21
- data/lib/fog/dnsimple/dns.rb +70 -35
- data/lib/fog/dnsimple/models/dns/record.rb +5 -5
- data/lib/fog/dnsimple/models/dns/records.rb +5 -5
- data/lib/fog/dnsimple/models/dns/zone.rb +3 -3
- data/lib/fog/dnsimple/models/dns/zones.rb +3 -3
- data/lib/fog/dnsimple/requests/dns/create_domain.rb +3 -12
- data/lib/fog/dnsimple/requests/dns/create_record.rb +4 -14
- data/lib/fog/dnsimple/requests/dns/delete_domain.rb +4 -9
- data/lib/fog/dnsimple/requests/dns/delete_record.rb +3 -7
- data/lib/fog/dnsimple/requests/dns/get_domain.rb +13 -12
- data/lib/fog/dnsimple/requests/dns/get_record.rb +15 -18
- data/lib/fog/dnsimple/requests/dns/list_all_domains.rb +38 -0
- data/lib/fog/dnsimple/requests/dns/list_all_records.rb +39 -0
- data/lib/fog/dnsimple/requests/dns/list_domains.rb +17 -17
- data/lib/fog/dnsimple/requests/dns/list_records.rb +18 -18
- data/lib/fog/dnsimple/requests/dns/update_record.rb +3 -10
- data/lib/fog/dnsimple/version.rb +1 -1
- data/lib/fog/dnsimple.rb +2 -0
- metadata +25 -85
- data/.gitignore +0 -9
- data/.ruby-gemset +0 -1
- data/.travis.yml +0 -18
- data/LICENSE.md +0 -20
- data/Rakefile +0 -9
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/fog-dnsimple.gemspec +0 -29
- data/tests/dns/helper.rb +0 -19
- data/tests/dns/models/record_tests.rb +0 -41
- data/tests/dns/models/records_tests.rb +0 -27
- data/tests/dns/models/zone_tests.rb +0 -15
- data/tests/dns/models/zones_tests.rb +0 -15
- data/tests/helper.rb +0 -11
- data/tests/helpers/mock_helper.rb +0 -6
- data/tests/requests/dns/dns_tests.rb +0 -122
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Fog
|
|
2
|
-
module
|
|
3
|
-
class
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
4
|
class Real
|
|
5
5
|
# Gets record from given domain.
|
|
6
6
|
#
|
|
@@ -13,11 +13,7 @@ module Fog
|
|
|
13
13
|
# * body<~Hash>:
|
|
14
14
|
# * "data"<~Hash> The representation of the record.
|
|
15
15
|
def get_record(zone_name, record_id)
|
|
16
|
-
request(
|
|
17
|
-
expects: 200,
|
|
18
|
-
method: "GET",
|
|
19
|
-
path: "/#{@dnsimple_account}/zones/#{zone_name}/records/#{record_id}"
|
|
20
|
-
)
|
|
16
|
+
request { |client| client.zones.zone_record(@dnsimple_account, zone_name, record_id) }
|
|
21
17
|
end
|
|
22
18
|
end
|
|
23
19
|
|
|
@@ -26,21 +22,22 @@ module Fog
|
|
|
26
22
|
response = Excon::Response.new
|
|
27
23
|
|
|
28
24
|
if self.data[:records].key?(zone_name)
|
|
29
|
-
|
|
30
|
-
response.body = { "data" => self.data[:records][zone_name].find { |record| record["id"] == record_id }}
|
|
25
|
+
payload = self.data[:records][zone_name].find { |record| record["id"] == record_id }
|
|
31
26
|
|
|
32
|
-
if
|
|
33
|
-
response.status =
|
|
34
|
-
response.body = {
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
if payload
|
|
28
|
+
response.status = 200
|
|
29
|
+
response.body = { "data" => payload }
|
|
30
|
+
else
|
|
31
|
+
# response.status = 404
|
|
32
|
+
# response.body = { "message" => "Record `#{record_id}` not found" }
|
|
33
|
+
raise Excon::Errors::NotFound, "Record `#{record_id}` not found"
|
|
37
34
|
end
|
|
38
35
|
else
|
|
39
|
-
response.status = 404
|
|
40
|
-
response.body = {
|
|
41
|
-
|
|
42
|
-
}
|
|
36
|
+
# response.status = 404
|
|
37
|
+
# response.body = { "message" => "Domain `#{zone_name}` not found" }
|
|
38
|
+
raise Excon::Errors::NotFound, "Domain `#{zone_name}` not found"
|
|
43
39
|
end
|
|
40
|
+
|
|
44
41
|
response
|
|
45
42
|
end
|
|
46
43
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
|
+
class Real
|
|
5
|
+
# Get the list of ALL domains in the account.
|
|
6
|
+
#
|
|
7
|
+
# This method is similar to #list_domains, but instead of returning the results
|
|
8
|
+
# of a specific page it iterates all the pages and returns the entire collection.
|
|
9
|
+
#
|
|
10
|
+
# Please use this method carefully, as fetching the entire collection will increase
|
|
11
|
+
# the number of requests you send to the API server and you may eventually be rate-limited.
|
|
12
|
+
#
|
|
13
|
+
# @see https://developer.dnsimple.com/v2/domains/#list
|
|
14
|
+
# @see https://github.com/dnsimple/dnsimple-developer/tree/master/fixtures/v2/listDomains
|
|
15
|
+
#
|
|
16
|
+
# @param query [Hash]
|
|
17
|
+
# @return [Excon::Response]
|
|
18
|
+
def list_all_domains(query: {})
|
|
19
|
+
paginate(query: query) do |current_query|
|
|
20
|
+
list_domains(query: current_query)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class Mock
|
|
26
|
+
def list_all_domains(_query: {})
|
|
27
|
+
response = Excon::Response.new
|
|
28
|
+
response.status = 200
|
|
29
|
+
response.body = {
|
|
30
|
+
"data" => self.data[:domains],
|
|
31
|
+
"pagination" => { "current_page" => nil, "per_page" => nil, "total_entries" => 60, "total_pages" => 2 }
|
|
32
|
+
}
|
|
33
|
+
response
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
|
+
class Real
|
|
5
|
+
# Get the list of ALL records for the specific zone.
|
|
6
|
+
#
|
|
7
|
+
# This method is similar to #list_domains, but instead of returning the results
|
|
8
|
+
# of a specific page it iterates all the pages and returns the entire collection.
|
|
9
|
+
#
|
|
10
|
+
# Please use this method carefully, as fetching the entire collection will increase
|
|
11
|
+
# the number of requests you send to the API server and you may eventually be rate-limited.
|
|
12
|
+
#
|
|
13
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#list
|
|
14
|
+
# @see https://github.com/dnsimple/dnsimple-developer/tree/master/fixtures/v2/listZoneRecords
|
|
15
|
+
#
|
|
16
|
+
# @param zone_name [String]
|
|
17
|
+
# @param query [Hash]
|
|
18
|
+
# @return [Excon::Response]
|
|
19
|
+
def list_all_records(zone_name, query: {})
|
|
20
|
+
paginate(query: query) do |current_query|
|
|
21
|
+
list_records(zone_name, query: current_query)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Mock
|
|
27
|
+
def list_all_records(zone_name, _query: {})
|
|
28
|
+
response = Excon::Response.new
|
|
29
|
+
response.status = 200
|
|
30
|
+
response.body = {
|
|
31
|
+
"data" => Array(self.data[:records][zone_name]),
|
|
32
|
+
"pagination" => { "current_page" => nil, "per_page" => nil, "total_entries" => 60, "total_pages" => 2 }
|
|
33
|
+
}
|
|
34
|
+
response
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
module Fog
|
|
2
|
-
module
|
|
3
|
-
class
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
4
|
class Real
|
|
5
|
-
# Get the list of domains in the account.
|
|
5
|
+
# Get the paginated list of domains in the account.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# @see https://developer.dnsimple.com/v2/domains/#list
|
|
8
|
+
# @see https://github.com/dnsimple/dnsimple-developer/tree/master/fixtures/v2/listDomains
|
|
8
9
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# * <~Hash> The representation of the domain.
|
|
14
|
-
def list_domains
|
|
15
|
-
request(
|
|
16
|
-
expects: 200,
|
|
17
|
-
method: "GET",
|
|
18
|
-
path: "/#{@dnsimple_account}/domains"
|
|
19
|
-
)
|
|
10
|
+
# @param query [Hash]
|
|
11
|
+
# @return [Excon::Response]
|
|
12
|
+
def list_domains(query: {})
|
|
13
|
+
request { |client| client.domains.list_domains(@dnsimple_account, query: query) }
|
|
20
14
|
end
|
|
21
15
|
end
|
|
22
16
|
|
|
23
17
|
class Mock
|
|
24
|
-
def list_domains
|
|
18
|
+
def list_domains(query: {})
|
|
19
|
+
page = query[:page] || 1
|
|
20
|
+
per_page = query[:per_page] || 30
|
|
21
|
+
|
|
25
22
|
response = Excon::Response.new
|
|
26
23
|
response.status = 200
|
|
27
|
-
response.body = {
|
|
24
|
+
response.body = {
|
|
25
|
+
"data" => self.data[:domains],
|
|
26
|
+
"pagination" => { "current_page" => page, "per_page" => per_page, "total_entries" => 60, "total_pages" => 2 }
|
|
27
|
+
}
|
|
28
28
|
response
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
module Fog
|
|
2
|
-
module
|
|
3
|
-
class
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
4
|
class Real
|
|
5
|
-
# Get the list of records for the specific
|
|
5
|
+
# Get the paginated list of records for the specific zone.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
# @see https://developer.dnsimple.com/v2/zones/records/#list
|
|
8
|
+
# @see https://github.com/dnsimple/dnsimple-developer/tree/master/fixtures/v2/listZoneRecords
|
|
9
9
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def list_records(zone_name)
|
|
16
|
-
request(
|
|
17
|
-
expects: 200,
|
|
18
|
-
method: "GET",
|
|
19
|
-
path: "/#{@dnsimple_account}/zones/#{zone_name}/records"
|
|
20
|
-
)
|
|
10
|
+
# @param zone_name [String]
|
|
11
|
+
# @param query [Hash]
|
|
12
|
+
# @return [Excon::Response]
|
|
13
|
+
def list_records(zone_name, query: {})
|
|
14
|
+
request { |client| client.zones.list_zone_records(@dnsimple_account, zone_name, query: query) }
|
|
21
15
|
end
|
|
22
16
|
end
|
|
23
17
|
|
|
24
18
|
class Mock
|
|
25
|
-
def list_records(zone_name)
|
|
19
|
+
def list_records(zone_name, query: {})
|
|
20
|
+
page = query[:page] || 1
|
|
21
|
+
per_page = query[:per_page] || 30
|
|
22
|
+
|
|
26
23
|
response = Excon::Response.new
|
|
27
24
|
response.status = 200
|
|
28
|
-
response.body = {
|
|
25
|
+
response.body = {
|
|
26
|
+
"data" => Array(self.data[:records][zone_name]),
|
|
27
|
+
"pagination" => { "current_page" => page, "per_page" => per_page, "total_entries" => 60, "total_pages" => 2 }
|
|
28
|
+
}
|
|
29
29
|
response
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Fog
|
|
2
|
-
module
|
|
3
|
-
class
|
|
2
|
+
module Dnsimple
|
|
3
|
+
class DNS
|
|
4
4
|
class Real
|
|
5
5
|
# Update the given record for the given domain.
|
|
6
6
|
#
|
|
@@ -18,14 +18,7 @@ module Fog
|
|
|
18
18
|
# * body<~Hash>:
|
|
19
19
|
# * "data"<~Hash> The representation of the record.
|
|
20
20
|
def update_record(zone_name, record_id, options)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
request(
|
|
24
|
-
body: Fog::JSON.encode(body),
|
|
25
|
-
expects: 200,
|
|
26
|
-
method: "PATCH",
|
|
27
|
-
path: "/#{@dnsimple_account}/zones/#{zone_name}/records/#{record_id}"
|
|
28
|
-
)
|
|
21
|
+
request { |client| client.zones.update_zone_record(@dnsimple_account, zone_name, record_id, options) }
|
|
29
22
|
end
|
|
30
23
|
end
|
|
31
24
|
|
data/lib/fog/dnsimple/version.rb
CHANGED
data/lib/fog/dnsimple.rb
CHANGED
metadata
CHANGED
|
@@ -1,111 +1,55 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fog-dnsimple
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simone Carletti
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
13
|
+
name: dnsimple
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
20
|
-
type: :
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.12'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '12.0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '12.0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: shindo
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0.3'
|
|
48
|
-
type: :development
|
|
18
|
+
version: '13.0'
|
|
19
|
+
type: :runtime
|
|
49
20
|
prerelease: false
|
|
50
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
22
|
requirements:
|
|
52
23
|
- - "~>"
|
|
53
24
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0
|
|
25
|
+
version: '13.0'
|
|
55
26
|
- !ruby/object:Gem::Dependency
|
|
56
27
|
name: fog-core
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '1.38'
|
|
62
|
-
- - "<"
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: '3'
|
|
65
|
-
type: :runtime
|
|
66
|
-
prerelease: false
|
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
-
requirements:
|
|
69
|
-
- - ">="
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
version: '1.38'
|
|
72
|
-
- - "<"
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: '3'
|
|
75
|
-
- !ruby/object:Gem::Dependency
|
|
76
|
-
name: fog-json
|
|
77
28
|
requirement: !ruby/object:Gem::Requirement
|
|
78
29
|
requirements:
|
|
79
30
|
- - "~>"
|
|
80
31
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
32
|
+
version: '2.5'
|
|
82
33
|
type: :runtime
|
|
83
34
|
prerelease: false
|
|
84
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
36
|
requirements:
|
|
86
37
|
- - "~>"
|
|
87
38
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
89
|
-
description:
|
|
90
|
-
|
|
91
|
-
to use the DNSimple in applications.
|
|
39
|
+
version: '2.5'
|
|
40
|
+
description: This library can be used as a module for `fog` or as standalone provider
|
|
41
|
+
to use the DNSimple in applications.
|
|
92
42
|
email:
|
|
93
|
-
-
|
|
43
|
+
- code@simonecarletti.com
|
|
94
44
|
executables: []
|
|
95
45
|
extensions: []
|
|
96
|
-
extra_rdoc_files:
|
|
46
|
+
extra_rdoc_files:
|
|
47
|
+
- LICENSE.txt
|
|
97
48
|
files:
|
|
98
|
-
- ".gitignore"
|
|
99
|
-
- ".ruby-gemset"
|
|
100
|
-
- ".travis.yml"
|
|
101
49
|
- CHANGELOG.md
|
|
102
50
|
- Gemfile
|
|
103
|
-
- LICENSE.
|
|
51
|
+
- LICENSE.txt
|
|
104
52
|
- README.md
|
|
105
|
-
- Rakefile
|
|
106
|
-
- bin/console
|
|
107
|
-
- bin/setup
|
|
108
|
-
- fog-dnsimple.gemspec
|
|
109
53
|
- lib/fog/bin/dnsimple.rb
|
|
110
54
|
- lib/fog/dnsimple.rb
|
|
111
55
|
- lib/fog/dnsimple/dns.rb
|
|
@@ -119,23 +63,21 @@ files:
|
|
|
119
63
|
- lib/fog/dnsimple/requests/dns/delete_record.rb
|
|
120
64
|
- lib/fog/dnsimple/requests/dns/get_domain.rb
|
|
121
65
|
- lib/fog/dnsimple/requests/dns/get_record.rb
|
|
66
|
+
- lib/fog/dnsimple/requests/dns/list_all_domains.rb
|
|
67
|
+
- lib/fog/dnsimple/requests/dns/list_all_records.rb
|
|
122
68
|
- lib/fog/dnsimple/requests/dns/list_domains.rb
|
|
123
69
|
- lib/fog/dnsimple/requests/dns/list_records.rb
|
|
124
70
|
- lib/fog/dnsimple/requests/dns/update_record.rb
|
|
125
71
|
- lib/fog/dnsimple/version.rb
|
|
126
|
-
- tests/dns/helper.rb
|
|
127
|
-
- tests/dns/models/record_tests.rb
|
|
128
|
-
- tests/dns/models/records_tests.rb
|
|
129
|
-
- tests/dns/models/zone_tests.rb
|
|
130
|
-
- tests/dns/models/zones_tests.rb
|
|
131
|
-
- tests/helper.rb
|
|
132
|
-
- tests/helpers/mock_helper.rb
|
|
133
|
-
- tests/requests/dns/dns_tests.rb
|
|
134
72
|
homepage: https://github.com/fog/fog-dnsimple
|
|
135
73
|
licenses:
|
|
136
74
|
- MIT
|
|
137
|
-
metadata:
|
|
138
|
-
|
|
75
|
+
metadata:
|
|
76
|
+
bug_tracker_uri: https://github.com/fog/fog-dnsimple/issues
|
|
77
|
+
changelog_uri: https://github.com/fog/fog-dnsimple/blob/main/CHANGELOG.md
|
|
78
|
+
documentation_uri: https://rubydoc.info/gems/fog-dnsimple/3.0.0
|
|
79
|
+
homepage_uri: https://github.com/fog/fog-dnsimple
|
|
80
|
+
source_code_uri: https://github.com/fog/fog-dnsimple/tree/v3.0.0
|
|
139
81
|
rdoc_options: []
|
|
140
82
|
require_paths:
|
|
141
83
|
- lib
|
|
@@ -143,16 +85,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
143
85
|
requirements:
|
|
144
86
|
- - ">="
|
|
145
87
|
- !ruby/object:Gem::Version
|
|
146
|
-
version: '
|
|
88
|
+
version: '3.2'
|
|
147
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
90
|
requirements:
|
|
149
91
|
- - ">="
|
|
150
92
|
- !ruby/object:Gem::Version
|
|
151
93
|
version: '0'
|
|
152
94
|
requirements: []
|
|
153
|
-
|
|
154
|
-
rubygems_version: 2.6.13
|
|
155
|
-
signing_key:
|
|
95
|
+
rubygems_version: 3.6.9
|
|
156
96
|
specification_version: 4
|
|
157
97
|
summary: Module for the 'fog' gem to support DNSimple.
|
|
158
98
|
test_files: []
|
data/.gitignore
DELETED
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fog-dnsimple
|
data/.travis.yml
DELETED
data/LICENSE.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016-2016 Aetrion LLC.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "fog/dnsimple"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/fog-dnsimple.gemspec
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'fog/dnsimple/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "fog-dnsimple"
|
|
8
|
-
spec.version = Fog::Dnsimple::VERSION
|
|
9
|
-
spec.authors = ["Simone Carletti"]
|
|
10
|
-
spec.email = ["weppos@weppos.net"]
|
|
11
|
-
|
|
12
|
-
spec.summary = %q{Module for the 'fog' gem to support DNSimple.}
|
|
13
|
-
spec.description = %q{This library can be used as a module for `fog` or as standalone provider
|
|
14
|
-
to use the DNSimple in applications.}
|
|
15
|
-
spec.homepage = "https://github.com/fog/fog-dnsimple"
|
|
16
|
-
spec.license = "MIT"
|
|
17
|
-
|
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
19
|
-
spec.bindir = "exe"
|
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
21
|
-
spec.require_paths = ["lib"]
|
|
22
|
-
|
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.12"
|
|
24
|
-
spec.add_development_dependency "rake", "~> 12.0"
|
|
25
|
-
spec.add_development_dependency "shindo", "~> 0.3"
|
|
26
|
-
|
|
27
|
-
spec.add_dependency 'fog-core', '>= 1.38', '< 3'
|
|
28
|
-
spec.add_dependency 'fog-json', '~> 1.0'
|
|
29
|
-
end
|
data/tests/dns/helper.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
def dns_providers
|
|
2
|
-
{
|
|
3
|
-
:dnsimple => {
|
|
4
|
-
:mocked => false
|
|
5
|
-
},
|
|
6
|
-
}
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def generate_unique_domain( with_trailing_dot = false)
|
|
10
|
-
#get time (with 1/100th of sec accuracy)
|
|
11
|
-
#want unique domain name and if provider is fast, this can be called more than once per second
|
|
12
|
-
time= (Time.now.to_f * 100).to_i
|
|
13
|
-
domain = 'test-' + time.to_s + '.com'
|
|
14
|
-
if with_trailing_dot
|
|
15
|
-
domain+= '.'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
domain
|
|
19
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
for provider, config in dns_providers
|
|
2
|
-
|
|
3
|
-
domain_name = uniq_id + '.com'
|
|
4
|
-
|
|
5
|
-
Shindo.tests("Fog::DNS[:#{provider}] | record", [provider.to_s]) do
|
|
6
|
-
|
|
7
|
-
a_record_attributes = {
|
|
8
|
-
:name => 'a.' + domain_name,
|
|
9
|
-
:type => 'A',
|
|
10
|
-
:value => '1.2.3.4'
|
|
11
|
-
}.merge!(config[:record_attributes] || {})
|
|
12
|
-
|
|
13
|
-
aaaa_record_attributes = {
|
|
14
|
-
:name => 'aaaa.' + domain_name,
|
|
15
|
-
:type => 'AAAA',
|
|
16
|
-
:value => '2001:0db8:0000:0000:0000:ff00:0042:8329'
|
|
17
|
-
}.merge!(config[:record_attributes] || {})
|
|
18
|
-
|
|
19
|
-
cname_record_attributes = {
|
|
20
|
-
:name => 'cname.' + domain_name,
|
|
21
|
-
:type => 'CNAME',
|
|
22
|
-
:value => 'real.' + domain_name
|
|
23
|
-
}.merge!(config[:record_attributes] || {})
|
|
24
|
-
|
|
25
|
-
if !Fog.mocking? || config[:mocked]
|
|
26
|
-
zone_attributes = {
|
|
27
|
-
:domain => domain_name
|
|
28
|
-
}.merge(config[:zone_attributes] || {})
|
|
29
|
-
|
|
30
|
-
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
|
31
|
-
|
|
32
|
-
model_tests(@zone.records, a_record_attributes, config[:mocked])
|
|
33
|
-
model_tests(@zone.records, aaaa_record_attributes, config[:mocked])
|
|
34
|
-
model_tests(@zone.records, cname_record_attributes, config[:mocked])
|
|
35
|
-
|
|
36
|
-
@zone.destroy
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
for provider, config in dns_providers
|
|
2
|
-
|
|
3
|
-
domain_name = uniq_id + '.com'
|
|
4
|
-
|
|
5
|
-
Shindo.tests("Fog::DNS[:#{provider}] | records", [provider.to_s]) do
|
|
6
|
-
|
|
7
|
-
record_attributes = {
|
|
8
|
-
:name => 'www.' + domain_name,
|
|
9
|
-
:type => 'A',
|
|
10
|
-
:value => '1.2.3.4'
|
|
11
|
-
}.merge!(config[:record_attributes] || {})
|
|
12
|
-
|
|
13
|
-
if !Fog.mocking? || config[:mocked]
|
|
14
|
-
zone_attributes = {
|
|
15
|
-
:domain => domain_name
|
|
16
|
-
}.merge(config[:zone_attributes] || {})
|
|
17
|
-
|
|
18
|
-
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
|
19
|
-
|
|
20
|
-
collection_tests(@zone.records, record_attributes, config[:mocked])
|
|
21
|
-
|
|
22
|
-
@zone.destroy
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|