Fog::Collection
# File lib/fog/digitalocean/models/compute/servers.rb, line 10 def all(filters = {}) data = service.list_servers.body['droplets'] load(data) end
# File lib/fog/digitalocean/models/compute/servers.rb, line 15 def bootstrap(new_attributes = {}) server = new(new_attributes) check_keys(new_attributes) credential = Fog.respond_to?(:credential) && Fog.credential || :default name = "fog_#{credential}" ssh_key = service.ssh_keys.find { |key| key.name == name } if ssh_key.nil? ssh_key = service.ssh_keys.create( :name => name, :ssh_pub_key => (new_attributes[:public_key] || File.read(new_attributes[:public_key_path])) ) end server.ssh_keys = [ssh_key] server.save server.wait_for { ready? } if new_attributes[:private_key] server.setup :key_data => [new_attributes[:private_key]] else server.setup :keys => [new_attributes[:private_key_path]] end server end
Generated with the Darkfish Rdoc Generator 2.