rackspace-monitoring 0.2.15 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.15
1
+ 0.2.18
@@ -22,6 +22,12 @@ module Fog
22
22
  collection :alarm_examples
23
23
  model :agent_token
24
24
  collection :agent_tokens
25
+ model :metric
26
+ collection :metrics
27
+ model :data_point
28
+ collection :data_points
29
+ model :check_type
30
+ collection :check_types
25
31
 
26
32
  request_path 'rackspace-monitoring/monitoring/requests'
27
33
  request :list_agent_tokens
@@ -29,6 +35,9 @@ module Fog
29
35
  request :list_alarm_examples
30
36
  request :list_checks
31
37
  request :list_entities
38
+ request :list_metrics
39
+ request :list_data_points
40
+ request :list_check_types
32
41
  request :list_overview
33
42
 
34
43
  request :get_agent_token
@@ -9,7 +9,14 @@ module Fog
9
9
  model Fog::Monitoring::Rackspace::AgentToken
10
10
 
11
11
  def all
12
- data = connection.list_agent_tokens.body['values']
12
+ data = []
13
+ opts = {}
14
+ begin
15
+ new_tokens = connection.list_agent_tokens(opts)
16
+ data.concat(new_tokens.body['values'])
17
+ opts = {:marker => new_tokens.body['metadata']['next_marker']}
18
+ end until opts[:marker].nil?
19
+
13
20
  load(data)
14
21
  end
15
22
 
@@ -57,6 +57,15 @@ module Fog
57
57
  true
58
58
  end
59
59
 
60
+ def metrics
61
+ @metrics ||= begin
62
+ Fog::Monitoring::Rackspace::Metrics.new(
63
+ :check => self,
64
+ :connection => connection
65
+ )
66
+ end
67
+ end
68
+
60
69
  end
61
70
 
62
71
  end
@@ -0,0 +1,15 @@
1
+ require 'rackspace-fog/core/model'
2
+ require 'rackspace-monitoring/monitoring/models/base'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class CheckType < Fog::Monitoring::Rackspace::Base
8
+ identity :id
9
+ attribute :type
10
+ attribute :fields
11
+ attribute :channel
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ require 'rackspace-fog/core/collection'
2
+ require 'rackspace-monitoring/monitoring/models/check_type'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class CheckTypes < Fog::Collection
8
+
9
+ model Fog::Monitoring::Rackspace::CheckType
10
+
11
+ def all
12
+ data = connection.list_check_types.body['values']
13
+ load(data)
14
+ end
15
+
16
+ def new(attributes = {})
17
+ super({ }.merge!(attributes))
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ require 'rackspace-fog/core/model'
2
+ require 'rackspace-monitoring/monitoring/models/base'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class DataPoint < Fog::Monitoring::Rackspace::Base
8
+ attribute :num_points, :aliases => "numPoints"
9
+ attribute :average
10
+ attribute :variance
11
+ attribute :min
12
+ attribute :max
13
+ attribute :timestamp
14
+ attribute :metric
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,49 @@
1
+ require 'rackspace-fog/core/collection'
2
+ require 'rackspace-monitoring/monitoring/models/data_point'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class DataPoints < Fog::Collection
8
+
9
+ attribute :metric
10
+
11
+ model Fog::Monitoring::Rackspace::DataPoint
12
+
13
+ def all
14
+ self.fetch(:resolution => :full)
15
+ end
16
+
17
+ # Fetch the datapoints for a metric
18
+ # ==== Parameters
19
+ #
20
+ # * options<~Hash> - optional paramaters
21
+ # * from<~Integer> - timestamp in milliseconds
22
+ # * to<~Integer> - timestamp in milliseconds
23
+ # * points<~Integer> - Number of points to fetch
24
+ # * resolution<~String> - Should be one of :full, :min5, :min20, :min60, :min240, :min1440
25
+ # * select<~Array> - Should be an array of :average, :max, :min, :variance
26
+ #
27
+ # ==== Returns
28
+ # * datapoints<~Fog::Monitoring::Rackspace::Datapoints>:
29
+ def fetch(options={})
30
+ requires :metric
31
+ options[:from] ||= (Time.now.to_i * 1000) - (3600 * 1000)
32
+ options[:to] ||= Time.now.to_i * 1000
33
+ options[:points] ||= 1 unless options[:resolution]
34
+ if options[:resolution]
35
+ options[:resolution] = options[:resolution].upcase
36
+ end
37
+ data = connection.list_data_points(metric.check.entity.id, metric.check.id, metric.name, options).body['values']
38
+ load(data)
39
+ end
40
+
41
+ def new(attributes = {})
42
+ requires :metric
43
+ super({ :metric => metric }.merge!(attributes))
44
+ end
45
+
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,25 @@
1
+ require 'rackspace-fog/core/model'
2
+ require 'rackspace-monitoring/monitoring/models/base'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class Metric < Fog::Monitoring::Rackspace::Base
8
+
9
+ identity :name
10
+ attribute :check
11
+
12
+ def datapoints(options={})
13
+ @datapoints ||= begin
14
+ Fog::Monitoring::Rackspace::DataPoints.new(
15
+ :metric => self,
16
+ :connection => connection
17
+ )
18
+ end
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ require 'rackspace-fog/core/collection'
2
+ require 'rackspace-monitoring/monitoring/models/metric'
3
+
4
+ module Fog
5
+ module Monitoring
6
+ class Rackspace
7
+ class Metrics < Fog::Collection
8
+
9
+ attribute :check
10
+
11
+ model Fog::Monitoring::Rackspace::Metric
12
+
13
+ def all
14
+ requires :check
15
+ data = connection.list_metrics(check.entity.id, check.id).body['values']
16
+ load(data)
17
+ end
18
+
19
+ def new(attributes = {})
20
+ requires :check
21
+ super({ :check => check }.merge!(attributes))
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -3,11 +3,12 @@ module Fog
3
3
  class Rackspace
4
4
  class Real
5
5
 
6
- def list_agent_tokens
6
+ def list_agent_tokens(options={})
7
7
  request(
8
8
  :expects => [200, 203],
9
9
  :method => 'GET',
10
- :path => "agent_tokens"
10
+ :path => 'agent_tokens',
11
+ :query => options
11
12
  )
12
13
  end
13
14
 
@@ -0,0 +1,17 @@
1
+ module Fog
2
+ module Monitoring
3
+ class Rackspace
4
+ class Real
5
+
6
+ def list_check_types
7
+ request(
8
+ :expects => [200, 203],
9
+ :method => 'GET',
10
+ :path => "check_types"
11
+ )
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module Fog
2
+ module Monitoring
3
+ class Rackspace
4
+ class Real
5
+
6
+ def list_data_points(entity_id, check_id, metric_name, options)
7
+ request(
8
+ :expects => [200, 203],
9
+ :method => 'GET',
10
+ :path => "entities/#{entity_id}/checks/#{check_id}/metrics/#{metric_name}/plot",
11
+ :query => options
12
+ )
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Fog
2
+ module Monitoring
3
+ class Rackspace
4
+ class Real
5
+
6
+ def list_metrics(entity_id, check_id)
7
+ request(
8
+ :expects => [200, 203],
9
+ :method => 'GET',
10
+ :path => "entities/#{entity_id}/checks/#{check_id}/metrics"
11
+ )
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+ end
18
+
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rackspace-monitoring"
8
- s.version = "0.2.15"
8
+ s.version = "0.2.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Di Spaltro"]
12
- s.date = "2013-03-17"
12
+ s.date = "2013-04-12"
13
13
  s.description = "Rackspace Cloud Monitoring Ruby Bindings, built on top of fog."
14
14
  s.email = "dan.dispaltro@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -32,9 +32,15 @@ Gem::Specification.new do |s|
32
32
  "lib/rackspace-monitoring/monitoring/models/alarms.rb",
33
33
  "lib/rackspace-monitoring/monitoring/models/base.rb",
34
34
  "lib/rackspace-monitoring/monitoring/models/check.rb",
35
+ "lib/rackspace-monitoring/monitoring/models/check_type.rb",
36
+ "lib/rackspace-monitoring/monitoring/models/check_types.rb",
35
37
  "lib/rackspace-monitoring/monitoring/models/checks.rb",
38
+ "lib/rackspace-monitoring/monitoring/models/data_point.rb",
39
+ "lib/rackspace-monitoring/monitoring/models/data_points.rb",
36
40
  "lib/rackspace-monitoring/monitoring/models/entities.rb",
37
41
  "lib/rackspace-monitoring/monitoring/models/entity.rb",
42
+ "lib/rackspace-monitoring/monitoring/models/metric.rb",
43
+ "lib/rackspace-monitoring/monitoring/models/metrics.rb",
38
44
  "lib/rackspace-monitoring/monitoring/requests/create_agent_token.rb",
39
45
  "lib/rackspace-monitoring/monitoring/requests/create_alarm.rb",
40
46
  "lib/rackspace-monitoring/monitoring/requests/create_check.rb",
@@ -50,8 +56,11 @@ Gem::Specification.new do |s|
50
56
  "lib/rackspace-monitoring/monitoring/requests/list_agent_tokens.rb",
51
57
  "lib/rackspace-monitoring/monitoring/requests/list_alarm_examples.rb",
52
58
  "lib/rackspace-monitoring/monitoring/requests/list_alarms.rb",
59
+ "lib/rackspace-monitoring/monitoring/requests/list_check_types.rb",
53
60
  "lib/rackspace-monitoring/monitoring/requests/list_checks.rb",
61
+ "lib/rackspace-monitoring/monitoring/requests/list_data_points.rb",
54
62
  "lib/rackspace-monitoring/monitoring/requests/list_entities.rb",
63
+ "lib/rackspace-monitoring/monitoring/requests/list_metrics.rb",
55
64
  "lib/rackspace-monitoring/monitoring/requests/list_overview.rb",
56
65
  "lib/rackspace-monitoring/monitoring/requests/update_alarm.rb",
57
66
  "lib/rackspace-monitoring/monitoring/requests/update_check.rb",
@@ -63,7 +72,7 @@ Gem::Specification.new do |s|
63
72
  s.homepage = "http://github.com/racker/rackspace-monitoring-rb"
64
73
  s.licenses = ["APACHE"]
65
74
  s.require_paths = ["lib"]
66
- s.rubygems_version = "1.8.25"
75
+ s.rubygems_version = "1.8.23"
67
76
  s.summary = "Rackspace Cloud Monitoring Ruby Bindings"
68
77
 
69
78
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackspace-monitoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rackspace-fog
@@ -114,9 +114,15 @@ files:
114
114
  - lib/rackspace-monitoring/monitoring/models/alarms.rb
115
115
  - lib/rackspace-monitoring/monitoring/models/base.rb
116
116
  - lib/rackspace-monitoring/monitoring/models/check.rb
117
+ - lib/rackspace-monitoring/monitoring/models/check_type.rb
118
+ - lib/rackspace-monitoring/monitoring/models/check_types.rb
117
119
  - lib/rackspace-monitoring/monitoring/models/checks.rb
120
+ - lib/rackspace-monitoring/monitoring/models/data_point.rb
121
+ - lib/rackspace-monitoring/monitoring/models/data_points.rb
118
122
  - lib/rackspace-monitoring/monitoring/models/entities.rb
119
123
  - lib/rackspace-monitoring/monitoring/models/entity.rb
124
+ - lib/rackspace-monitoring/monitoring/models/metric.rb
125
+ - lib/rackspace-monitoring/monitoring/models/metrics.rb
120
126
  - lib/rackspace-monitoring/monitoring/requests/create_agent_token.rb
121
127
  - lib/rackspace-monitoring/monitoring/requests/create_alarm.rb
122
128
  - lib/rackspace-monitoring/monitoring/requests/create_check.rb
@@ -132,8 +138,11 @@ files:
132
138
  - lib/rackspace-monitoring/monitoring/requests/list_agent_tokens.rb
133
139
  - lib/rackspace-monitoring/monitoring/requests/list_alarm_examples.rb
134
140
  - lib/rackspace-monitoring/monitoring/requests/list_alarms.rb
141
+ - lib/rackspace-monitoring/monitoring/requests/list_check_types.rb
135
142
  - lib/rackspace-monitoring/monitoring/requests/list_checks.rb
143
+ - lib/rackspace-monitoring/monitoring/requests/list_data_points.rb
136
144
  - lib/rackspace-monitoring/monitoring/requests/list_entities.rb
145
+ - lib/rackspace-monitoring/monitoring/requests/list_metrics.rb
137
146
  - lib/rackspace-monitoring/monitoring/requests/list_overview.rb
138
147
  - lib/rackspace-monitoring/monitoring/requests/update_alarm.rb
139
148
  - lib/rackspace-monitoring/monitoring/requests/update_check.rb
@@ -154,9 +163,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
163
  - - ! '>='
155
164
  - !ruby/object:Gem::Version
156
165
  version: '0'
157
- segments:
158
- - 0
159
- hash: -2447514613286196878
160
166
  required_rubygems_version: !ruby/object:Gem::Requirement
161
167
  none: false
162
168
  requirements:
@@ -165,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
171
  version: '0'
166
172
  requirements: []
167
173
  rubyforge_project:
168
- rubygems_version: 1.8.25
174
+ rubygems_version: 1.8.23
169
175
  signing_key:
170
176
  specification_version: 3
171
177
  summary: Rackspace Cloud Monitoring Ruby Bindings