Sha256: ac94407342da0c13acf7205646b320bc12631edb64b345bac721b34580ee13f0

Contents?: true

Size: 1.07 KB

Versions: 39

Compression:

Stored size: 1.07 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

39 entries across 37 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.10 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.1.30 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.1.29 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.9 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.1.28 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.8 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.7 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.6 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.5 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.4 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.3 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.2 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.3.0 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.2.4 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.2.3 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.2.2 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.2.1 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-openstack-0.2.0 lib/fog/volume/openstack/requests/update_volume_type.rb
fog-zj-0.1.28 lib/fog/volume/openstack/requests/update_volume_type.rb