Sha256: 90efb4702069f2367a78cd475cf80ecbfef0e5268d0a6d9a9d1c5e0a0c0776e1

Contents?: true

Size: 1.05 KB

Versions: 12

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Volume
    class OpenStack
      module Real
        def update_volume_type(volume_type_id, options = {})
          data = {
            'volume_type' => {}
          }

          vanilla_options = [:name, :extra_specs]
          vanilla_options.select { |o| options[o] }.each do |key|
            data['volume_type'][key] = options[key]
          end
          request(
            :body     => Fog::JSON.encode(data),
            :expects  => [200, 202],
            :method   => 'PUT',
            :path     => "types/#{volume_type_id}"
          )
        end
      end

      module Mock
        def update_volume_type(volume_type_id, options = {})
          response = Excon::Response.new
          response.status = 202
          response.body = {
            "volume_type"=> {
              "id"=> "6685584b-1eac-4da6-b5c3-555430cf68ff",
              "name"=> "vol-type-001",
              "extra_specs"=> {
                  "capabilities"=> "gpu"
              }
            }
          }
          response
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.9 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.8 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.7 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.6 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.5 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/volume/update_volume_type.rb
fog-1.37.0 lib/fog/openstack/requests/volume/update_volume_type.rb