Sha256: 155176e59afc4915031e7e559ac7cd679b496956e32c430bb862adf5cc093148
Contents?: true
Size: 921 Bytes
Versions: 43
Compression:
Stored size: 921 Bytes
Contents
require 'fog/core/collection' require 'fog/cloudstack/models/compute/server' module Fog module Compute class Cloudstack class Servers < Fog::Collection model Fog::Compute::Cloudstack::Server def all(attributes={}) response = service.list_virtual_machines(attributes) data = response["listvirtualmachinesresponse"]["virtualmachine"] || [] load(data) end def bootstrap(new_attributes = {}) server = create(new_attributes) server.wait_for { ready? } server end def get(server_id) servers = service.list_virtual_machines('id' => server_id)["listvirtualmachinesresponse"]["virtualmachine"] unless servers.nil? || servers.empty? new(servers.first) end rescue Fog::Compute::Cloudstack::BadRequest nil end end end end end
Version data entries
43 entries across 43 versions & 3 rubygems