class Fog::Network::Softlayer::Datacenters

Public Class Methods

new(attributes) click to toggle source
Calls superclass method
# File lib/fog/softlayer/models/network/datacenters.rb, line 18
def initialize(attributes)
  self.filters ||= {}
  super
end

Public Instance Methods

all(filters = self.filters) click to toggle source
# File lib/fog/softlayer/models/network/datacenters.rb, line 23
def all(filters = self.filters)
  self.filters = filters
  load(service.get_datacenters.body)
end
by_name(name) click to toggle source
# File lib/fog/softlayer/models/network/datacenters.rb, line 35
def by_name(name)
  all.map { |dc| dc if dc.name == name }.compact.first
end
get(id) click to toggle source
# File lib/fog/softlayer/models/network/datacenters.rb, line 28
def get(id)
  data = service.request(:location_datacenter, "#{id}/get_object").body
    new.merge_attributes(data)
rescue Fog::Network::Softlayer::NotFound
  nil
end