Sha256: e1f7650fe381c360c47785b20aabbb50172d8808736b432edc0e55e68889e59f
Contents?: true
Size: 1.47 KB
Versions: 2
Compression:
Stored size: 1.47 KB
Contents
module Fog module Compute class OracleCloud class Real def create_security_application(name, protocol, options={}) body_data = { 'name' => name, 'protocol' => protocol, 'dport' => options[:dport], 'icmptype' => options[:icmptype], 'icmpcode' => options[:icmpcode], 'description' => options[:description] } body_data = body_data.reject {|key, value| value.nil?} request( :method => 'POST', :expects => 201, :path => "/secapplication/", :body => Fog::JSON.encode(body_data), :headers => { 'Content-Type' => 'application/oracle-compute-v3+json' } ) end end class Mock def create_security_application(name, protocol, options={}) response = Excon::Response.new name.sub! "/Compute-#{@identity_domain}/#{@username}/", '' data = { 'name' => "/Compute-#{@identity_domain}/#{@username}/#{name}", 'protcol' => protocol, 'uri' => "#{@api_endpoint}seclist/#{name}" } self.data[:security_applications][name] = data response.status = 201 response.body = self.data[:security_applications][name] response end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-oraclecloud-0.1.17 | lib/fog/oraclecloud/requests/compute/create_security_application.rb |
fog-oraclecloud-0.1.16 | lib/fog/oraclecloud/requests/compute/create_security_application.rb |