Class: Fog::Compute::Bluebox::Servers

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/bluebox/models/compute/servers.rb

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
# File 'lib/fog/bluebox/models/compute/servers.rb', line 10

def all
  data = service.get_blocks.body
  load(data)
end

#bootstrap(new_attributes = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/bluebox/models/compute/servers.rb', line 15

def bootstrap(new_attributes = {})
  server = create(new_attributes)
  server.wait_for { ready? }
  server.setup(:key_data => [server.private_key])
  server
end

#get(server_id) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/fog/bluebox/models/compute/servers.rb', line 22

def get(server_id)
  if server_id && server = service.get_block(server_id).body
    new(server)
  end
rescue Fog::Compute::Bluebox::NotFound
  nil
end