cloud_party 0.1.2 → 0.1.3
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 +4 -4
- data/lib/cloud_party.rb +0 -3
- data/lib/cloud_party/nodes/zones.rb +44 -1
- data/lib/cloud_party/simple.rb +0 -4
- data/lib/cloud_party/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57fa5791a1ef6bcc7a52dae9ba8717d46b2e18d990e827845be08107e7ed848f
|
4
|
+
data.tar.gz: 144340c2bd1bef54ef5cf7606d50718e0f068b1177cfe601e2b28860d9cfce24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 004c8e19201510f10310974dc3311bebd21db74704a7dc500995c32bf7068decdeda160e12812936b17383888cf8a23925d3991052d38855458fee37de15b654
|
7
|
+
data.tar.gz: 1f752e39c576840a1ce8eba1da503be428fb4f1419af637eaa1b6ccd011eaa25f2945cf2e5b8aabc786dd7d35449d6faa483920fe2e9cbe6d8b44c47bd5c1d78
|
data/lib/cloud_party.rb
CHANGED
@@ -13,7 +13,21 @@ module CloudParty
|
|
13
13
|
'Content-Type' => 'application/json',
|
14
14
|
'User-Agent' => "CloudParty/#{CloudParty::VERSION}"
|
15
15
|
|
16
|
-
def
|
16
|
+
def self.set_id_by_name(zone)
|
17
|
+
options = {
|
18
|
+
match: 'all',
|
19
|
+
name: zone,
|
20
|
+
order: 'name'
|
21
|
+
}
|
22
|
+
if @options.nil?
|
23
|
+
@options = options
|
24
|
+
else
|
25
|
+
@options.merge!(options)
|
26
|
+
end
|
27
|
+
|
28
|
+
@@zone = CloudParty::Responses::Zones.new(:get, '/zones', get('/zones', query: @options), @options).result.first.fetch(:id, nil)
|
29
|
+
end
|
30
|
+
def initialize(options = {})
|
17
31
|
super()
|
18
32
|
@options = options
|
19
33
|
end
|
@@ -25,6 +39,35 @@ module CloudParty
|
|
25
39
|
def get(id)
|
26
40
|
CloudParty::Responses::Zones.new(:get, '/zones/:id', self.class.get("/zones/#{id}"), @options)
|
27
41
|
end
|
42
|
+
|
43
|
+
def add_record(type, name, content, opts, zone:)
|
44
|
+
zone_id = nil
|
45
|
+
options = {
|
46
|
+
type: type,
|
47
|
+
name: name,
|
48
|
+
content: content
|
49
|
+
}
|
50
|
+
ttl = opts.fetch('ttl', nil)
|
51
|
+
priority = opts.fetch('priority', nil)
|
52
|
+
proxied = opts.fetch('proxied', nil)
|
53
|
+
options.merge!(ttl: ttl) unless ttl.nil?
|
54
|
+
options.merge!(priority: priority) unless priority.nil?
|
55
|
+
options.merge!(proxied: proxied) unless proxied.nil?
|
56
|
+
if zone
|
57
|
+
zone_options = {
|
58
|
+
match: 'all',
|
59
|
+
name: zone,
|
60
|
+
order: 'name'
|
61
|
+
}
|
62
|
+
zone_id = CloudParty::Responses::Zones.new(:get, '/zones', get('/zones', query: zone_options), @options).result.first.fetch(:id, nil)
|
63
|
+
end
|
64
|
+
|
65
|
+
CloudParty::Responses::Zones.new(
|
66
|
+
:post,
|
67
|
+
'/zones/',
|
68
|
+
self.class.get("/zones/#{@@zone || zone_id}/dns_records", options),
|
69
|
+
@options)
|
70
|
+
end
|
28
71
|
end
|
29
72
|
end
|
30
73
|
end
|
data/lib/cloud_party/simple.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rubyflare'
|
4
3
|
require 'app_configuration'
|
5
4
|
module CloudParty
|
6
5
|
class Simple
|
@@ -31,8 +30,5 @@ module CloudParty
|
|
31
30
|
@api_key
|
32
31
|
end
|
33
32
|
|
34
|
-
def connect
|
35
|
-
Rubyflare.connect_with(email, api_key)
|
36
|
-
end
|
37
33
|
end
|
38
34
|
end
|
data/lib/cloud_party/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Spencer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|