r53z 0.3.1 → 0.3.2
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/Gemfile.lock +1 -1
- data/bin/r53z +2 -2
- data/lib/r53z/cli.rb +10 -5
- data/lib/r53z/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a76e281d58be3c97125591da8dd480f32cc6cb5
|
4
|
+
data.tar.gz: 68e49615f4b31b8f390e2c92c0b4eeb7d36251e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f3e3e61987f2387d890147b5d71945b6cbb8a815ec35640f6d7c773943651d075eadd0ef19f1b7569f4dbb0f883cf30451325332e170802e98a0ef6233277a5
|
7
|
+
data.tar.gz: 90e2b3812b188c15a6f556eda3d3047eecf70fd4eeafbff9df995f2f8c671ddc71933a809433e9caa6d11afccc8b0a6e840371365d23562279f213e2d9fe561d
|
data/Gemfile.lock
CHANGED
data/bin/r53z
CHANGED
@@ -17,8 +17,8 @@ class App
|
|
17
17
|
description "Simple CLI to manage, backup, and restore, Route 53 zones"
|
18
18
|
#
|
19
19
|
# Accept flags via:
|
20
|
-
on("-x", "--export", "Export zones to files in specified directory, optionally specify one or more zones.")
|
21
|
-
on("-r", "--restore", "Restore zone from directory, optionally specify one or more zones.")
|
20
|
+
on("-x DIR", "--export", "Export zones to files in specified directory, optionally specify one or more zones.")
|
21
|
+
on("-r DIR", "--restore", "Restore zone from directory, optionally specify one or more zones.")
|
22
22
|
on("-l", "--list", "List name and ID of one or all zones.")
|
23
23
|
on("-s", "--record-sets", "List record sets for the given zone.")
|
24
24
|
on("-c NAME", "--create", "Create a zone with the given name and optional --comment and --delegation-set.")
|
data/lib/r53z/cli.rb
CHANGED
@@ -14,12 +14,14 @@ module R53z
|
|
14
14
|
# XXX Dispatch table seems smarter...can't figure out how to call methods based
|
15
15
|
# directly on hash keys at the moment.
|
16
16
|
if options[:export]
|
17
|
-
|
17
|
+
unless Dir.exists?(File.expand_path(options[:export]))
|
18
|
+
help_now! "Export requires a directory path for zone files."
|
19
|
+
end
|
18
20
|
export(:options => options, :args => args)
|
19
21
|
end
|
20
22
|
|
21
23
|
if options[:restore]
|
22
|
-
|
24
|
+
unless Dir.exists?(File.expand_path(options[:restore]))
|
23
25
|
help_now! "Restore requires a directory containing zone files and optionally one or more zones to restore."
|
24
26
|
end
|
25
27
|
restore(:options => options, :args => args)
|
@@ -73,15 +75,18 @@ module R53z
|
|
73
75
|
end
|
74
76
|
|
75
77
|
def export(options:, args:)
|
76
|
-
path =
|
78
|
+
path = File.expand_path(options[:export])
|
77
79
|
# If no zones, dump all zones
|
78
80
|
zones = []
|
79
81
|
# One zone, multiple, or all?
|
80
82
|
if args.empty?
|
81
|
-
@client.list.each do |zone|
|
83
|
+
@client.list(:delegation_set_id => options['delegation-set']).each do |zone|
|
82
84
|
zones.push(zone[:name])
|
83
85
|
end
|
84
86
|
else
|
87
|
+
if options['delegation-set']
|
88
|
+
puts "--delegation-set is overridden when one or more zones are provided"
|
89
|
+
end
|
85
90
|
zones = args
|
86
91
|
end
|
87
92
|
|
@@ -91,7 +96,7 @@ module R53z
|
|
91
96
|
end
|
92
97
|
|
93
98
|
def restore(options:, args:)
|
94
|
-
path =
|
99
|
+
path = File.expand_path(options[:restore])
|
95
100
|
# If no zones, restore all zones in directory
|
96
101
|
zones = []
|
97
102
|
if args.empty?
|
data/lib/r53z/version.rb
CHANGED