Sha256: 56870cfdd574de6642f8615700479f575ee741a37e1c2d6568ed5029f7dd0db3

Contents?: true

Size: 1.47 KB

Versions: 39

Compression:

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

39 entries across 39 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.21.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.20.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/openstack/requests/volume/list_volumes.rb
fog-1.19.0 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/openstack/requests/volume/list_volumes.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/requests/volume/list_volumes.rb