rackspace-monitoring 0.2.18 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
- gem "rackspace-fog", "= 1.4.2"
5
+ gem "fog", ">= 1.11.1", :path => '/w/fog'
6
6
 
7
7
  # Add dependencies to develop your gem here.
8
8
  # Include everything needed to run rake, tests, features, etc.
data/Gemfile.lock ADDED
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: /w/fog
3
+ specs:
4
+ fog (1.12.1)
5
+ builder
6
+ excon (~> 0.25.0)
7
+ formatador (~> 0.2.0)
8
+ mime-types
9
+ multi_json (~> 1.0)
10
+ net-scp (~> 1.1)
11
+ net-ssh (>= 2.1.3)
12
+ nokogiri (~> 1.5.0)
13
+ ruby-hmac
14
+
15
+ GEM
16
+ remote: http://rubygems.org/
17
+ specs:
18
+ activesupport (3.2.13)
19
+ i18n (= 0.6.1)
20
+ multi_json (~> 1.0)
21
+ builder (3.2.2)
22
+ excon (0.25.0)
23
+ formatador (0.2.4)
24
+ git (1.2.5)
25
+ i18n (0.6.1)
26
+ jeweler (1.8.4)
27
+ bundler (~> 1.0)
28
+ git (>= 1.2.5)
29
+ rake
30
+ rdoc
31
+ json (1.8.0)
32
+ mime-types (1.23)
33
+ multi_json (1.7.7)
34
+ net-scp (1.1.1)
35
+ net-ssh (>= 2.6.5)
36
+ net-ssh (2.6.7)
37
+ nokogiri (1.5.10)
38
+ rake (10.1.0)
39
+ rdoc (3.12.2)
40
+ json (~> 1.4)
41
+ ruby-hmac (0.4.0)
42
+ shoulda (3.5.0)
43
+ shoulda-context (~> 1.0, >= 1.0.1)
44
+ shoulda-matchers (>= 1.4.1, < 3.0)
45
+ shoulda-context (1.1.3)
46
+ shoulda-matchers (2.2.0)
47
+ activesupport (>= 3.0.0)
48
+
49
+ PLATFORMS
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ bundler (>= 1.0.0)
54
+ fog (>= 1.11.1)!
55
+ jeweler (~> 1.8.3)
56
+ rdoc (~> 3.12)
57
+ shoulda
data/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This project contains the Ruby bindings for the Rackspace Cloud Monitoring product. It is based off the most awesome Fog cloud services library here - https://github.com/fog/fog. This library is used heavily in the https://github.com/racker/cookbook-cloudmonitoring chef cookbook.
4
4
 
5
+ # Example Code
6
+
7
+ Below is an example to list entities on your account:
8
+
9
+ ```ruby
10
+ require 'rackspace-monitoring'
11
+
12
+ monitoring = Fog::Monitoring::Rackspace.new(:rackspace_api_key => '<API-KEY>', :rackspace_username => '<USERNAME>')
13
+ print monitoring.entities.overview
14
+
15
+ ```
16
+
5
17
  # Contributing
6
18
 
7
19
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
@@ -12,6 +24,7 @@ This project contains the Ruby bindings for the Rackspace Cloud Monitoring produ
12
24
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
25
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
26
 
27
+
15
28
  # Publish a New Version
16
29
 
17
30
  * Run tests `rake test`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.18
1
+ 0.3.1
@@ -1,5 +1,5 @@
1
- require 'rackspace-fog'
2
- require 'rackspace-fog/core'
1
+ require 'fog'
2
+ require 'fog/core'
3
3
 
4
4
  module Fog
5
5
  module Monitoring
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -23,9 +23,9 @@ module Fog
23
23
  def save
24
24
  options = prep
25
25
  if identity then
26
- data = connection.update_agent_token(identity, options)
26
+ data = service.update_agent_token(identity, options)
27
27
  else
28
- data = connection.create_agent_token(options)
28
+ data = service.create_agent_token(options)
29
29
  end
30
30
  true
31
31
  end
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/agent_token'
3
3
 
4
4
  module Fog
@@ -12,7 +12,7 @@ module Fog
12
12
  data = []
13
13
  opts = {}
14
14
  begin
15
- new_tokens = connection.list_agent_tokens(opts)
15
+ new_tokens = service.list_agent_tokens(opts)
16
16
  data.concat(new_tokens.body['values'])
17
17
  opts = {:marker => new_tokens.body['metadata']['next_marker']}
18
18
  end until opts[:marker].nil?
@@ -21,7 +21,7 @@ module Fog
21
21
  end
22
22
 
23
23
  def get(id)
24
- data = connection.get_agent_token(id).body
24
+ data = service.get_agent_token(id).body
25
25
  new(data)
26
26
  rescue Fog::Monitoring::Rackspace::NotFound
27
27
  nil
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -30,11 +30,11 @@ module Fog
30
30
  requires :notification_plan_id
31
31
  options = prep
32
32
  if identity then
33
- data = connection.update_alarm(get_entity_id, identity, options)
33
+ data = service.update_alarm(get_entity_id, identity, options)
34
34
  else
35
35
  options['check_type'] = check_type if check_type
36
36
  options['check_id'] = check_id if check_id
37
- data = connection.create_alarm(get_entity_id, options)
37
+ data = service.create_alarm(get_entity_id, options)
38
38
  end
39
39
  true
40
40
  end
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/alarm_example'
3
3
 
4
4
  module Fog
@@ -9,19 +9,19 @@ module Fog
9
9
  model Fog::Monitoring::Rackspace::AlarmExample
10
10
 
11
11
  def all
12
- data = connection.list_alarm_examples.body['values']
12
+ data = service.list_alarm_examples.body['values']
13
13
  load(data)
14
14
  end
15
15
 
16
16
  def get(alarm_example_id)
17
- data = connection.get_alarm_example(alarm_example_id).body
17
+ data = service.get_alarm_example(alarm_example_id).body
18
18
  new(data)
19
19
  rescue Fog::Monitoring::Rackspace::NotFound
20
20
  nil
21
21
  end
22
22
 
23
23
  def evaluate(alarm_example_id, options={})
24
- data = connection.evaluate_alarm_example(alarm_example_id, options).body
24
+ data = service.evaluate_alarm_example(alarm_example_id, options).body
25
25
  new(data)
26
26
  end
27
27
 
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/alarm'
3
3
 
4
4
  module Fog
@@ -12,13 +12,13 @@ module Fog
12
12
 
13
13
  def all
14
14
  requires :entity
15
- data = connection.list_alarms(entity.identity).body['values']
15
+ data = service.list_alarms(entity.identity).body['values']
16
16
  load(data)
17
17
  end
18
18
 
19
19
  def get(alarm_id)
20
20
  requires :entity
21
- data = connection.get_alarm(entity.identity, alarm_id).body
21
+ data = service.get_alarm(entity.identity, alarm_id).body
22
22
  new(data)
23
23
  rescue Fog::Monitoring::Rackspace::NotFound
24
24
  nil
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -48,11 +48,11 @@ module Fog
48
48
  end
49
49
  options = prep
50
50
  if identity then
51
- data = connection.update_check(entity_id, identity, options)
51
+ data = service.update_check(entity_id, identity, options)
52
52
  else
53
53
  requires :type
54
54
  options['type'] = type
55
- data = connection.create_check(entity_id, options)
55
+ data = service.create_check(entity_id, options)
56
56
  end
57
57
  true
58
58
  end
@@ -61,7 +61,7 @@ module Fog
61
61
  @metrics ||= begin
62
62
  Fog::Monitoring::Rackspace::Metrics.new(
63
63
  :check => self,
64
- :connection => connection
64
+ :service => service
65
65
  )
66
66
  end
67
67
  end
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/check_type'
3
3
 
4
4
  module Fog
@@ -9,7 +9,7 @@ module Fog
9
9
  model Fog::Monitoring::Rackspace::CheckType
10
10
 
11
11
  def all
12
- data = connection.list_check_types.body['values']
12
+ data = service.list_check_types.body['values']
13
13
  load(data)
14
14
  end
15
15
 
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/check'
3
3
 
4
4
  module Fog
@@ -12,13 +12,13 @@ module Fog
12
12
 
13
13
  def all
14
14
  requires :entity
15
- data = connection.list_checks(entity.identity).body['values']
15
+ data = service.list_checks(entity.identity).body['values']
16
16
  load(data)
17
17
  end
18
18
 
19
19
  def get(check_id)
20
20
  requires :entity
21
- data = connection.get_check(entity.identity, check_id).body
21
+ data = service.get_check(entity.identity, check_id).body
22
22
  new(data)
23
23
  rescue Fog::Monitoring::Rackspace::NotFound
24
24
  nil
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/data_point'
3
3
 
4
4
  module Fog
@@ -34,7 +34,7 @@ module Fog
34
34
  if options[:resolution]
35
35
  options[:resolution] = options[:resolution].upcase
36
36
  end
37
- data = connection.list_data_points(metric.check.entity.id, metric.check.id, metric.name, options).body['values']
37
+ data = service.list_data_points(metric.check.entity.id, metric.check.id, metric.name, options).body['values']
38
38
  load(data)
39
39
  end
40
40
 
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/entity'
3
3
  require 'rackspace-monitoring/monitoring/models/check'
4
4
 
@@ -10,12 +10,12 @@ module Fog
10
10
  model Fog::Monitoring::Rackspace::Entity
11
11
 
12
12
  def all
13
- data = connection.list_entities.body['values']
13
+ data = service.list_entities.body['values']
14
14
  load(data)
15
15
  end
16
16
 
17
17
  def get(entity_id)
18
- data = connection.get_entity(entity_id).body
18
+ data = service.get_entity(entity_id).body
19
19
  new(data)
20
20
  rescue Fog::Monitoring::Rackspace::NotFound
21
21
  nil
@@ -25,7 +25,7 @@ module Fog
25
25
  entities = []
26
26
  opts = {}
27
27
  begin
28
- new_entities = connection.list_overview(opts)
28
+ new_entities = service.list_overview(opts)
29
29
  entities.concat(new_entities.body['values'])
30
30
  opts = {:marker => new_entities.body['metadata']['next_marker']}
31
31
  end while(!opts[:marker].nil?)
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -29,9 +29,9 @@ module Fog
29
29
  def save
30
30
  options = prep
31
31
  if identity then
32
- data = connection.update_entity(identity, options)
32
+ data = service.update_entity(identity, options)
33
33
  else
34
- data = connection.create_entity(options)
34
+ data = service.create_entity(options)
35
35
  end
36
36
  true
37
37
  end
@@ -40,7 +40,7 @@ module Fog
40
40
  @checks ||= begin
41
41
  Fog::Monitoring::Rackspace::Checks.new(
42
42
  :entity => self,
43
- :connection => connection
43
+ :service => service
44
44
  )
45
45
  end
46
46
  end
@@ -49,14 +49,14 @@ module Fog
49
49
  @alarms ||= begin
50
50
  Fog::Monitoring::Rackspace::Alarms.new(
51
51
  :entity => self,
52
- :connection => connection
52
+ :service => service
53
53
  )
54
54
  end
55
55
  end
56
56
 
57
57
  def destroy
58
58
  requires :id
59
- connection.delete_entity(id)
59
+ service.delete_entity(id)
60
60
  end
61
61
 
62
62
  end
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/model'
1
+ require 'fog/core/model'
2
2
  require 'rackspace-monitoring/monitoring/models/base'
3
3
 
4
4
  module Fog
@@ -13,7 +13,7 @@ module Fog
13
13
  @datapoints ||= begin
14
14
  Fog::Monitoring::Rackspace::DataPoints.new(
15
15
  :metric => self,
16
- :connection => connection
16
+ :service => service
17
17
  )
18
18
  end
19
19
  end
@@ -1,4 +1,4 @@
1
- require 'rackspace-fog/core/collection'
1
+ require 'fog/core/collection'
2
2
  require 'rackspace-monitoring/monitoring/models/metric'
3
3
 
4
4
  module Fog
@@ -12,7 +12,7 @@ module Fog
12
12
 
13
13
  def all
14
14
  requires :check
15
- data = connection.list_metrics(check.entity.id, check.id).body['values']
15
+ data = service.list_metrics(check.entity.id, check.id).body['values']
16
16
  load(data)
17
17
  end
18
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.18"
8
+ s.version = "0.3.1"
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-04-12"
12
+ s.date = "2013-06-22"
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 = [
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
+ "Gemfile.lock",
22
23
  "LICENSE.txt",
23
24
  "README.md",
24
25
  "Rakefile",
@@ -72,27 +73,27 @@ Gem::Specification.new do |s|
72
73
  s.homepage = "http://github.com/racker/rackspace-monitoring-rb"
73
74
  s.licenses = ["APACHE"]
74
75
  s.require_paths = ["lib"]
75
- s.rubygems_version = "1.8.23"
76
+ s.rubygems_version = "1.8.24"
76
77
  s.summary = "Rackspace Cloud Monitoring Ruby Bindings"
77
78
 
78
79
  if s.respond_to? :specification_version then
79
80
  s.specification_version = 3
80
81
 
81
82
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
82
- s.add_runtime_dependency(%q<rackspace-fog>, ["= 1.4.2"])
83
+ s.add_runtime_dependency(%q<fog>, [">= 1.11.1"])
83
84
  s.add_development_dependency(%q<shoulda>, [">= 0"])
84
85
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
85
86
  s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
86
87
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
87
88
  else
88
- s.add_dependency(%q<rackspace-fog>, ["= 1.4.2"])
89
+ s.add_dependency(%q<fog>, [">= 1.11.1"])
89
90
  s.add_dependency(%q<shoulda>, [">= 0"])
90
91
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
91
92
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
92
93
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
93
94
  end
94
95
  else
95
- s.add_dependency(%q<rackspace-fog>, ["= 1.4.2"])
96
+ s.add_dependency(%q<fog>, [">= 1.11.1"])
96
97
  s.add_dependency(%q<shoulda>, [">= 0"])
97
98
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
98
99
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
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.18
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-12 00:00:00.000000000 Z
12
+ date: 2013-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rackspace-fog
15
+ name: fog
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - '='
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.4.2
21
+ version: 1.11.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - '='
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.4.2
29
+ version: 1.11.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: shoulda
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +101,7 @@ extra_rdoc_files:
101
101
  files:
102
102
  - .document
103
103
  - Gemfile
104
+ - Gemfile.lock
104
105
  - LICENSE.txt
105
106
  - README.md
106
107
  - Rakefile
@@ -163,6 +164,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
164
  - - ! '>='
164
165
  - !ruby/object:Gem::Version
165
166
  version: '0'
167
+ segments:
168
+ - 0
169
+ hash: 3279114146114637358
166
170
  required_rubygems_version: !ruby/object:Gem::Requirement
167
171
  none: false
168
172
  requirements:
@@ -171,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
175
  version: '0'
172
176
  requirements: []
173
177
  rubyforge_project:
174
- rubygems_version: 1.8.23
178
+ rubygems_version: 1.8.24
175
179
  signing_key:
176
180
  specification_version: 3
177
181
  summary: Rackspace Cloud Monitoring Ruby Bindings