Sha256: f9b2770b8564f8d62afce245da422204103256a5be6d24939496b28a7f2e66d4

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
      	def create_security_ip_list(name, description, secipentries)
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''

          body_data     = {
            'name'                => "/Compute-#{@identity_domain}/#{@username}/#{name}",
            'description'         => description,
            'secipentries'        => secipentries,
          }
          body_data = body_data.reject {|key, value| value.nil?}
          request(
            :method   => 'POST',
            :expects  => 201,
            :path     => "/seciplist/",
            :body     => Fog::JSON.encode(body_data),
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json'
            }
          )

      	end
      end

      class Mock
        def create_security_ip_list(name, description, secipentries)
          response = Excon::Response.new
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''

          data = {
            'name'                => "/Compute-#{@identity_domain}/#{@username}/#{name}",
            'description'         => description,
            'secipentries'        => secipentries,
            'uri'                 => "#{@api_endpoint}seclist/#{name}"
          }
          self.data[:security_ip_lists][name] = data

          response.status = 201
          response.body = self.data[:security_ip_lists][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_ip_list.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/compute/create_security_ip_list.rb