uptrends 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/uptrends/base.rb +20 -0
- data/lib/uptrends/checkpoint.rb +8 -0
- data/lib/uptrends/client.rb +15 -0
- data/lib/uptrends/probe.rb +2 -14
- data/lib/uptrends/probe_group.rb +2 -14
- data/lib/uptrends/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fa8b9b3cc7b45b11bacd36e2c011c66e272830
|
4
|
+
data.tar.gz: 94ced9671b00a46aa74dbb7d32e94bee4eb0b6f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a1536e1e06ecf5c14ced0ef67ccc6c28cddc6022ced43d874489ec3ee25a68819b524ee99efd24729827b667976322325fa68909710192836cee034bc77eb6
|
7
|
+
data.tar.gz: 0af5cd18bef97137322ec8c2583389ae698db370b09ae55ca5eb397b479dea89a55ccc8692ad71ac1f20b9b236ce0c34710161ab46c27cba0b515caf94b8191f
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'uptrends/utils'
|
3
|
+
|
4
|
+
module Uptrends
|
5
|
+
class Base
|
6
|
+
|
7
|
+
attr_reader :original_hash, :attributes
|
8
|
+
|
9
|
+
def initialize(probe_hash = {})
|
10
|
+
@original_hash = probe_hash
|
11
|
+
|
12
|
+
Uptrends::Utils.gen_and_set_accessors(self)
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
Uptrends::Utils.to_s(self)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
data/lib/uptrends/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "httparty"
|
2
2
|
require "uptrends/probe"
|
3
3
|
require "uptrends/probe_group"
|
4
|
+
require "uptrends/checkpoint"
|
4
5
|
require "uptrends/utils"
|
5
6
|
require "uptrends/api_error"
|
6
7
|
|
@@ -32,6 +33,14 @@ module Uptrends
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
36
|
+
def checkpoints(opts = {})
|
37
|
+
if opts[:refresh]
|
38
|
+
@checkpoints = get_checkpoints
|
39
|
+
else
|
40
|
+
@checkpoints ||= get_checkpoints
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
35
44
|
def probe_groups
|
36
45
|
@probe_groups ||= get_probe_groups
|
37
46
|
end
|
@@ -108,6 +117,10 @@ module Uptrends
|
|
108
117
|
get_all(Uptrends::Probe)
|
109
118
|
end
|
110
119
|
|
120
|
+
def get_checkpoints
|
121
|
+
get_all(Uptrends::Checkpoint)
|
122
|
+
end
|
123
|
+
|
111
124
|
def get_probe_groups
|
112
125
|
get_all(Uptrends::ProbeGroup)
|
113
126
|
end
|
@@ -118,6 +131,8 @@ module Uptrends
|
|
118
131
|
uri = '/probegroups'
|
119
132
|
when Uptrends::Probe
|
120
133
|
uri = '/probes'
|
134
|
+
when Uptrends::Checkpoint
|
135
|
+
uri = '/checkpointservers'
|
121
136
|
else
|
122
137
|
fail("You passed an unknown type. Try Uptrends::Probe or Uptrends::ProbeGroup")
|
123
138
|
end
|
data/lib/uptrends/probe.rb
CHANGED
@@ -1,20 +1,8 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'uptrends/utils'
|
3
|
+
require 'uptrends/base'
|
3
4
|
|
4
5
|
module Uptrends
|
5
|
-
class Probe
|
6
|
-
|
7
|
-
attr_reader :original_hash, :attributes
|
8
|
-
|
9
|
-
def initialize(probe_hash = {})
|
10
|
-
@original_hash = probe_hash
|
11
|
-
|
12
|
-
Uptrends::Utils.gen_and_set_accessors(self)
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_s
|
16
|
-
Uptrends::Utils.to_s(self)
|
17
|
-
end
|
18
|
-
|
6
|
+
class Probe < Base
|
19
7
|
end
|
20
8
|
end
|
data/lib/uptrends/probe_group.rb
CHANGED
@@ -1,20 +1,8 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'uptrends/utils'
|
3
|
+
require 'uptrends/base'
|
3
4
|
|
4
5
|
module Uptrends
|
5
|
-
class ProbeGroup
|
6
|
-
|
7
|
-
attr_reader :original_hash, :attributes
|
8
|
-
|
9
|
-
def initialize(probe_group_hash = {})
|
10
|
-
@original_hash = probe_group_hash
|
11
|
-
|
12
|
-
Uptrends::Utils.gen_and_set_accessors(self)
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_s
|
16
|
-
Uptrends::Utils.to_s(self)
|
17
|
-
end
|
18
|
-
|
6
|
+
class ProbeGroup < Base
|
19
7
|
end
|
20
8
|
end
|
data/lib/uptrends/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uptrends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Barnett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -49,6 +49,7 @@ extra_rdoc_files: []
|
|
49
49
|
files:
|
50
50
|
- ".gitignore"
|
51
51
|
- ".travis.yml"
|
52
|
+
- CHANGELOG.md
|
52
53
|
- Gemfile
|
53
54
|
- LICENSE.txt
|
54
55
|
- README.md
|
@@ -58,6 +59,8 @@ files:
|
|
58
59
|
- examples/update_all_probe_attributes.rb
|
59
60
|
- lib/uptrends.rb
|
60
61
|
- lib/uptrends/api_error.rb
|
62
|
+
- lib/uptrends/base.rb
|
63
|
+
- lib/uptrends/checkpoint.rb
|
61
64
|
- lib/uptrends/client.rb
|
62
65
|
- lib/uptrends/probe.rb
|
63
66
|
- lib/uptrends/probe_group.rb
|