Sha256: 4b534ab62a09072b1174b6376811ef7142f59f0445103e889dd6b740d96bbdc3

Contents?: true

Size: 1009 Bytes

Versions: 12

Compression:

Stored size: 1009 Bytes

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
      	def create_volume(name, size, high_latency = false, options={})
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", '' # Just in case it's already set
          body_data     = {
            'name'             		=> "/Compute-#{@identity_domain}/#{@username}/#{name}",
            'size'						    => size,
            'properties'          => []
          }
          body_data['properties'].push(high_latency ? "/oracle/public/storage/latency" : '/oracle/public/storage/default')
          body_data = body_data.reject {|key, value| value.nil?}

          request(
            :method   => 'POST',
            :expects  => 201,
            :path     => "/storage/volume/",
            :body     => Fog::JSON.encode(body_data),
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json'
            }
          )
      	end
      end
    end
  end
end
     

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.12 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.2 lib/fog/oraclecloud/requests/compute/create_volume.rb
fog-oraclecloud-0.1.1 lib/fog/oraclecloud/requests/compute/create_volume.rb