rackspace-monitoring 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -14,15 +14,18 @@ module Fog
14
14
  attribute :agent_id
15
15
 
16
16
  def save
17
- raise Fog::Errors::Error.new('Update not implemented yet.') if identity
18
- requires :label
19
17
  options = {
18
+ 'label' => label,
20
19
  'metadata' => metadata,
21
20
  'ip_addresses'=> ip_addresses,
22
21
  'agent_id' => agent_id
23
22
  }
24
23
  options = options.reject {|key, value| value.nil?}
25
- data = connection.create_entity(label, options)
24
+ if identity then
25
+ data = connection.update_entity(identity, options)
26
+ else
27
+ data = connection.create_entity(options)
28
+ end
26
29
  true
27
30
  end
28
31
 
@@ -3,15 +3,11 @@ module Fog
3
3
  class Rackspace
4
4
  class Real
5
5
 
6
- def create_entity(label, options = {})
6
+ def create_entity(options = {})
7
7
  data = {}
8
- data['label'] = label
9
- if options['metadata']
10
- data['metadata'] = options['metadata']
11
- end
12
- if options['ip_addresses']
13
- data['ip_addresses'] = options['ip_addresses']
14
- end
8
+ data['label'] = options['label']
9
+ data['metadata'] = options['metadata']
10
+ data['ip_addresses'] = options['ip_addresses']
15
11
  request(
16
12
  :body => MultiJson.encode(data),
17
13
  :expects => [201],
@@ -0,0 +1,22 @@
1
+ module Fog
2
+ module Monitoring
3
+ class Rackspace
4
+ class Real
5
+
6
+ def update_entity(entity_id, options = {})
7
+ data = {}
8
+ data['label'] = options['label']
9
+ data['metadata'] = options['metadata']
10
+ data['ip_addresses'] = options['ip_addresses']
11
+ request(
12
+ :body => MultiJson.encode(data),
13
+ :expects => [201],
14
+ :method => 'PUT',
15
+ :path => "entities/#{entity_id}"
16
+ )
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
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.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -123,6 +123,7 @@ files:
123
123
  - lib/rackspace-monitoring/monitoring/requests/list_checks.rb
124
124
  - lib/rackspace-monitoring/monitoring/requests/list_entities.rb
125
125
  - lib/rackspace-monitoring/monitoring/requests/list_overview.rb
126
+ - lib/rackspace-monitoring/monitoring/requests/update_entity.rb
126
127
  - test/helper.rb
127
128
  - test/test_rackspace-monitoring.rb
128
129
  homepage: http://github.com/racker/rackspace-monitoring-rb
@@ -140,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
141
  version: '0'
141
142
  segments:
142
143
  - 0
143
- hash: 1660523492308502531
144
+ hash: -784515959203329952
144
145
  required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  none: false
146
147
  requirements: