Sha256: 633fe470e8fe8f6df8cc30c1aa9b1f6600d3ad1cb8d00a55c652ccc030608e72

Contents?: true

Size: 1.88 KB

Versions: 7

Compression:

Stored size: 1.88 KB

Contents

module Fog
  module OracleCloud
    class SOA
      class Real

        def create_instance(service_name, topology, cloudStorageContainer, cloudStorageUser, cloudStoragePassword, parameters, options={})
          body_data     = {
            'serviceName'             => service_name,
            'topology'                => topology,
            'cloudStorageContainer'   => cloudStorageContainer,
            'cloudStorageUser'        => cloudStorageUser,
            'cloudStoragePassword'    => cloudStoragePassword,
            'parameters'              => parameters,
            'level'                   => options[:level],
            'subscriptionType'        => options[:subscriptionType],
            'description'             => options[:description],
            'sampleAppDeploymentRequests' => options[:sampleAppDeploymentRequests]
          }
          body_data = body_data.reject {|key, value| value.nil?}
          request(
            :method   => 'POST',
            :expects  => 202,
            :path     => "/paas/service/soa/api/v1.1/instances/#{@identity_domain}",
            :body     => Fog::JSON.encode(body_data),
            #:headers  => {
            #	'Content-Type'=>'application/vnd.com.oracle.oracloud.provisioning.Service+json'
            #}
          )
        end

      end

      class Mock
        def create_instance(service_name, topology, cloudStorageContainer, cloudStorageUser, cloudStoragePassword, parameters, options={})
      		response = Excon::Response.new

      		instance = Fog::OracleCloud::Mock.create_instance(service_name)
          self.data[:instances][service_name] = instance

      		response.status = 202
          response.headers['Location'] =  "https://jaas.oraclecloud.com/paas/service/dbcs/api/v1.1/instances/agriculture/status/create/job/2781084"
          response
      	end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.2 lib/fog/oraclecloud/requests/soa/create_instance.rb
fog-oraclecloud-0.1.1 lib/fog/oraclecloud/requests/soa/create_instance.rb