Class: CacheBuster::Rackspace
- Inherits:
-
Object
- Object
- CacheBuster::Rackspace
- Defined in:
- lib/cache-buster/rackspace.rb
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ Rackspace
constructor
A new instance of Rackspace.
- #servers ⇒ Object
Constructor Details
#initialize ⇒ Rackspace
Returns a new instance of Rackspace.
4 5 6 7 8 9 10 11 |
# File 'lib/cache-buster/rackspace.rb', line 4 def initialize @connection = Fog::Compute.new( :provider => 'Rackspace', :rackspace_api_key => ENV['RACKSPACE_API_KEY'], :rackspace_username => ENV['RACKSPACE_USERNAME'], :rackspace_region => :lon ) end |
Instance Method Details
#clear ⇒ Object
13 14 15 16 17 18 |
# File 'lib/cache-buster/rackspace.rb', line 13 def clear servers.each do |server_id| @connection.reboot_server(server_id, 'SOFT') sleep 90 end end |
#servers ⇒ Object
20 21 22 |
# File 'lib/cache-buster/rackspace.rb', line 20 def servers ENV['RACKSPACE_SERVER_IDS'].split(',') end |