Sha256: 76691a076bcb9ec7e55ebaa6c175a0732891cab30410b72e597b4d746db25272

Contents?: true

Size: 1.39 KB

Versions: 5

Compression:

Stored size: 1.39 KB

Contents

module Fog
  module OracleCloud
    class Java
      class Real

      	def scale_a_node(service_name, server_name, options={})

          path = "/paas/service/jcs/api/v1.1/instances/#{@identity_domain}/#{service_name}/#{server_name}"
          body_data     = {
            'shape'             => options[:shape],
            'additionalStorage' => options[:additionalStorage],
            'ignoreManagedServerHeapError' =>  options[:ignoreManagedServerHeapError],
            'scalingVolume'             => options[:scalingVolume]
          }
          body_data = body_data.reject {|key, value| value.nil?}

 		      response = request(
            :expects  => 202,
            :method   => 'PUT',
            :path     => path,
            :body     => Fog::JSON.encode(body_data)
          )
          response
        end
      end

      class Mock
        def scale_a_node(service_name, server_name, options={})
      	  response = Excon::Response.new

          response.status = 202
          self.data[:servers][service_name][server_name][:status] = 'Ready'
          self.data[:servers][service_name][server_name][:shape] = options[:shape]
          response.body = {
            "status" => "New", 
            "details" => {
              "message" => "scaleup.job.submitted", 
              "jobId" => rand(10000).to_s
            }
          }
          response
      	end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/requests/java/scale_a_node.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/java/scale_a_node.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/requests/java/scale_a_node.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/requests/java/scale_a_node.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/requests/java/scale_a_node.rb