# File lib/fog/softlayer/requests/compute/get_virtual_guest_by_ip.rb, line 11 def get_virtual_guest_by_ip(ip_address) response = Excon::Response.new response.body = @virtual_guests.map {|vm| vm if vm['primaryIpAddress'] == ip_address }.compact.first || {} response.status = response.body.empty? ? 404 : 200 if response.status == 404 response.body = { "error"=>"Unable to find object with ip of '#{ip_address}'.", "code"=>"SoftLayer_Exception_ObjectNotFound" } end response end