2012-01-22 10:38:02 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/ovirt/models/compute/server'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Ovirt
|
|
|
|
class Servers < Fog::Collection
|
|
|
|
model Fog::Compute::Ovirt::Server
|
|
|
|
|
|
|
|
def all(filters = {})
|
2012-12-22 18:24:20 -05:00
|
|
|
load service.list_virtual_machines(filters)
|
2012-01-22 10:38:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(id)
|
2012-12-22 18:24:20 -05:00
|
|
|
new service.get_virtual_machine(id)
|
2012-01-22 10:38:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def bootstrap(new_attributes = {})
|
|
|
|
server = create(new_attributes)
|
|
|
|
server.wait_for { stopped? }
|
|
|
|
server.start
|
|
|
|
server
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|