Sha256: 84d19ed2d697c41d6c079681f4e0e013b33b60f8de84d743c370c5020d8df442
Contents?: true
Size: 1.04 KB
Versions: 3
Compression:
Stored size: 1.04 KB
Contents
module Fog module Compute class OracleCloud class Real def get_ip_reservation(name) name.sub! "/Compute-#{@identity_domain}/#{@username}/", '' response = request( :expects => 200, :method => 'GET', :path => "/ip/reservation/Compute-#{@identity_domain}/#{@username}/#{name}", :headers => { 'Content-Type' => 'application/oracle-compute-v3+json', 'Accept' => 'application/oracle-compute-v3+json' } ) response end end class Mock def get_ip_reservation(name) response = Excon::Response.new clean_name = name.sub "/Compute-#{@identity_domain}/#{@username}/", '' if ip = self.data[:ip_reservations][clean_name] response.status = 200 response.body = ip response else; raise Fog::Compute::OracleCloud::NotFound.new("IP Reservation #{name} does not exist"); end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems