Sha256: a21e8fb4a35a5c1b2a95c106983529a41cd077e1817330b0153534b9c6f30076

Contents?: true

Size: 1.46 KB

Versions: 21

Compression:

Stored size: 1.46 KB

Contents

module Fog
  module Volume
    class OpenStack
      class Real
        def list_volumes(detailed=true, options={})
          path = detailed ? 'volumes/detail' : 'volumes'
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => path,
            :query    => options
          )
        end
      end

      class Mock
        def list_volumes(detailed=true, options={})
          response = Excon::Response.new
          response.status = 200
          self.data[:volumes] ||= [
            { "status" => "available",
              "display_description" => "test 1 desc",
              "availability_zone" => "nova",
              "display_name" => "Volume1",
              "attachments" => [{}],
              "volume_type" => nil,
              "snapshot_id" => nil,
              "size" => 1,
              "id" => 1,
              "created_at" => Time.now,
              "metadata" => {} },
            { "status" => "available",
              "display_description" => "test 2 desc",
              "availability_zone" => "nova",
              "display_name" => "Volume2",
              "attachments" => [{}],
              "volume_type" => nil,
              "snapshot_id" => nil,
              "size" => 1,
              "id" => 2,
              "created_at" => Time.now,
              "metadata" => {} }
            ]
          response.body = { 'volumes' => self.data[:volumes] }
          response
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
fog-1.31.0 lib/fog/openstack/requests/volume/list_volumes.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.30.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.29.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.28.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.27.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.26.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.25.0 lib/fog/openstack/requests/volume/list_volumes.rb
nsidc-fog-1.24.1 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.24.0 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.11 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.10 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.9 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.8 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.7 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.6 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.23.0 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.4 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.3 lib/fog/openstack/requests/volume/list_volumes.rb
ns-fog-1.22.2 lib/fog/openstack/requests/volume/list_volumes.rb