Sha256: 7d734e6011f0d4ca56f364e37dbfca3188e78e323d9516d45aee255733256ce4

Contents?: true

Size: 1.41 KB

Versions: 39

Compression:

Stored size: 1.41 KB

Contents

module Fog
  module Volume
    class OpenStack
      class Real

        def list_volumes(detailed=true)

          path = detailed ? 'volumes/detail' : 'volumes'
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => path
          )
        end

      end

      class Mock

        def list_volumes(detailed=true)
          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

39 entries across 39 versions & 10 rubygems

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/openstack/requests/volume/list_volumes.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.12.1.2.1 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.15.0 lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.14.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.14.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.13.0 lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.12.1.2 lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.12.1.1 lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.12.1a lib/fog/openstack/requests/volume/list_volumes.rb
gapinc-fog-1.12.1 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.12.1 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.12.0 lib/fog/openstack/requests/volume/list_volumes.rb
hpfog-0.0.20 lib/fog/openstack/requests/volume/list_volumes.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/requests/volume/list_volumes.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/requests/volume/list_volumes.rb
fog-nirvanix-1.8.2 lib/fog/openstack/requests/volume/list_volumes.rb