dynect-utils 0.0.1 → 0.0.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.
- data/Gemfile.lock +1 -1
- data/bin/check_dynect_gslb_region +16 -2
- data/dynect-utils.gemspec +3 -4
- metadata +46 -64
data/Gemfile.lock
CHANGED
@@ -5,6 +5,7 @@ require "rubygems"
|
|
5
5
|
require "bundler/setup"
|
6
6
|
|
7
7
|
require "dynect_rest"
|
8
|
+
require "timeout"
|
8
9
|
require "trollop"
|
9
10
|
|
10
11
|
progname = File.basename($0)
|
@@ -22,10 +23,23 @@ opts = Trollop::options do
|
|
22
23
|
:required => true
|
23
24
|
opt :region, "GSLB region", :short => "-R", :type => :string,
|
24
25
|
:default => "global"
|
26
|
+
opt :timeout, "Dynect API timeout", :short => "-t", :type => :integer,
|
27
|
+
:default => 10
|
25
28
|
end
|
26
29
|
|
27
|
-
|
28
|
-
|
30
|
+
gslb = nil
|
31
|
+
begin
|
32
|
+
Timeout::timeout(opts[:timeout]) do
|
33
|
+
dyn = DynectRest.new(opts[:customer], opts[:user], opts[:pass], opts[:zone])
|
34
|
+
gslb = dyn.get("GSLB/#{opts[:zone]}/#{opts[:record]}")
|
35
|
+
end
|
36
|
+
rescue Timeout::Error, Errno::ENETUNREACH => e
|
37
|
+
puts "UNKNOWN: dynect api timed out (#{$!})"
|
38
|
+
exit 3
|
39
|
+
rescue DynectRest::Exceptions::RequestFailed => e
|
40
|
+
puts "UNKNOWN: dynect api error, #{$!}"
|
41
|
+
exit 3
|
42
|
+
end
|
29
43
|
|
30
44
|
region = gslb["region"].select { |r| r["region_code"] == opts[:region] }.first
|
31
45
|
if region.nil?
|
data/dynect-utils.gemspec
CHANGED
@@ -3,14 +3,13 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "dynect-utils"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.2"
|
7
7
|
s.authors = ["Pete Fritchman"]
|
8
8
|
s.email = ["petef@databits.net"]
|
9
9
|
s.homepage = "https://github.com/fetep/dynect-utils"
|
10
10
|
s.summary = %q{Utilities to interact with the DynECT API}
|
11
|
-
s.description = %q{
|
12
|
-
|
13
|
-
the serving mode of GSLB addresses
|
11
|
+
s.description = %q{Utilities included: nagios plugin to check GSLB status,
|
12
|
+
tool to manipulate the serving mode of GSLB addresses
|
14
13
|
}
|
15
14
|
|
16
15
|
s.rubyforge_project = "dynect-utils"
|
metadata
CHANGED
@@ -1,73 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynect-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 29
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
5
|
+
version: 0.0.2
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
|
-
- Pete Fritchman
|
8
|
+
- Pete Fritchman
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2012-
|
13
|
+
date: 2012-06-20 00:00:00 Z
|
19
14
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
hash: 3
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
46
|
-
type: :runtime
|
47
|
-
version_requirements: *id002
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: dynect_rest
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: trollop
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
48
37
|
description: |
|
49
|
-
|
50
|
-
|
51
|
-
the serving mode of GSLB addresses
|
38
|
+
Utilities included: nagios plugin to check GSLB status,
|
39
|
+
tool to manipulate the serving mode of GSLB addresses
|
52
40
|
|
53
41
|
email:
|
54
|
-
- petef@databits.net
|
42
|
+
- petef@databits.net
|
55
43
|
executables:
|
56
|
-
- check_dynect_gslb_region
|
57
|
-
- dynect_gslb_manage
|
44
|
+
- check_dynect_gslb_region
|
45
|
+
- dynect_gslb_manage
|
58
46
|
extensions: []
|
59
47
|
|
60
48
|
extra_rdoc_files: []
|
61
49
|
|
62
50
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- Gemfile
|
65
|
-
- Gemfile.lock
|
66
|
-
- README.md
|
67
|
-
- Rakefile
|
68
|
-
- bin/check_dynect_gslb_region
|
69
|
-
- bin/dynect_gslb_manage
|
70
|
-
- dynect-utils.gemspec
|
51
|
+
- .gitignore
|
52
|
+
- Gemfile
|
53
|
+
- Gemfile.lock
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- bin/check_dynect_gslb_region
|
57
|
+
- bin/dynect_gslb_manage
|
58
|
+
- dynect-utils.gemspec
|
71
59
|
homepage: https://github.com/fetep/dynect-utils
|
72
60
|
licenses: []
|
73
61
|
|
@@ -75,29 +63,23 @@ post_install_message:
|
|
75
63
|
rdoc_options: []
|
76
64
|
|
77
65
|
require_paths:
|
78
|
-
- lib
|
66
|
+
- lib
|
79
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
68
|
none: false
|
81
69
|
requirements:
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
88
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
74
|
none: false
|
90
75
|
requirements:
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
segments:
|
95
|
-
- 0
|
96
|
-
version: "0"
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
97
79
|
requirements: []
|
98
80
|
|
99
81
|
rubyforge_project: dynect-utils
|
100
|
-
rubygems_version: 1.8.
|
82
|
+
rubygems_version: 1.8.15
|
101
83
|
signing_key:
|
102
84
|
specification_version: 3
|
103
85
|
summary: Utilities to interact with the DynECT API
|