Sha256: 7ddc5c62703f9b60e1b7f766c64292b5feeeb403ca1c3a2693c315bdead74038

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

module Fog
  module OracleCloud
    class Database
      class Real

      	def scale_instance(name, options={})
          body_data     = {
            'shape'             => options[:shape],
            'additionalStorage' => options[:additional_storage],
            'usage'             => options[:usage]
          }
          body_data = body_data.reject {|key, value| value.nil?}
        
          request(
            :method   => 'PUT',
            :expects  => 202,
            :path     => "/paas/service/dbcs/api/v1.1/instances/#{@identity_domain}/#{name}",
            :body     => Fog::JSON.encode(body_data),
          )
        end
      end

      class Mock
        def scale_instance(name, options={})
      		response = Excon::Response.new

          self.data[:instances][name]['status'] = 'Maintenance'
          info = { 'time'=> Time.now }
          if (options[:shape]) then
            info['attribute'] = 'shape'
            info['value'] = options[:shape]
          end
          self.data[:maintenance_at][name] = info
          response.status = 202
          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/database/scale_instance.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/database/scale_instance.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/requests/database/scale_instance.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/requests/database/scale_instance.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/requests/database/scale_instance.rb