Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::Softlayer::Servers

Public Instance Methods

all() click to toggle source
# File lib/fog/softlayer/models/compute/servers.rb, line 19
def all
  data = service.list_servers
  load(data)
end
bootstrap(options={}) click to toggle source
# File lib/fog/softlayer/models/compute/servers.rb, line 42
def bootstrap(options={})
  server = service.create(options)
  server.wait_for { ready? }
  server
end
get(identifier) click to toggle source

Get a SoftLayer server.

# File lib/fog/softlayer/models/compute/servers.rb, line 27
def get(identifier)
  return nil if identifier.nil? || identifier == ""
  response = service.get_vm(identifier)
  bare_metal = false
  if response.status == 404 # we didn't find it as a VM, look for a BMC server
    response = service.get_bare_metal_server(identifier)
    bare_metal = true
  end
  data = response.body
  data['bare_metal'] = bare_metal
  new.merge_attributes(data)
rescue Excon::Errors::NotFound
  nil
end
tagged_with(tags) click to toggle source
# File lib/fog/softlayer/models/compute/servers.rb, line 48
def tagged_with(tags)
  raise ArgumentError, "Tags argument for #{self.class.name}##{__method__} must be Array." unless tags.is_a?(Array)
  ids = service.get_references_by_tag_name(tags.join(',')).body.map do |tag|
    tag['references'].map do |ref|
      ref['resourceTableId']
    end
  end.flatten.uniq
  ids.map { |id| get(id) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.