Sha256: 7191fb55a0f23a8a39d3137345a2c9b7d0be5e7514e5a23bb59dd980798a2b6c

Contents?: true

Size: 1.57 KB

Versions: 29

Compression:

Stored size: 1.57 KB

Contents

module Fog
  module HP
    class BlockStorage
      class Real
        # List existing block storage volumes
        #
        # ==== Parameters
        # None
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Array>:
        #     * volumes<~Hash>:
        #       * 'id'<~Integer>: - Id for the volume
        #       * 'displayName'<~String>: - Name of the volume
        #       * 'displayDescription'<~String>: - Description of the volume
        #       * 'size'<~Integer>: - Size in GB for the volume
        #       * 'status'<~String>: - Status of the volume i.e. "available"
        #       * 'volumeType'<~String>: - Type of the volume
        #       * 'snapshotId'<~String>: - Id of the volume snapshot
        #       * 'createdAt'<~String>: - Timestamp in UTC when volume was created
        #       * 'availabilityZone'<~String>: - Availability zone i.e. "nova"
        #       * attachments<~Array>: Array of hashes of attachments
        #       * metadata<~Hash>: Hash of metadata for the volume
        def list_volumes
          response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => 'os-volumes'
          )
          response
        end
      end

      class Mock # :nodoc:all
        def list_volumes
          response = Excon::Response.new
          volumes = []
          volumes = self.data[:volumes].values unless self.data[:volumes].nil?

          response.status = 200
          response.body = { 'volumes' => volumes }
          response
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
ns-fog-1.22.9 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.8 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.7 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.6 lib/fog/hp/requests/block_storage/list_volumes.rb
fog-1.23.0 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.4 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.3 lib/fog/hp/requests/block_storage/list_volumes.rb
ns-fog-1.22.2 lib/fog/hp/requests/block_storage/list_volumes.rb
fog-1.22.1 lib/fog/hp/requests/block_storage/list_volumes.rb