Sha256: e6896ecdbbaffe23637983ece832bfb64fa79e6a1400a9170abf2a4b50b22603

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

module Fog
  module Volume
    class OpenStack
      module Real
        def list_snapshots(options = true, options_deprecated = {})
          if options.is_a?(Hash)
            path  = 'snapshots'
            query = options
          else
            # Backwards compatibility layer, when 'detailed' boolean was sent as first param
            if options
              Fog::Logger.deprecation('Calling OpenStack[:volume].list_snapshots(true) is deprecated, use .list_snapshots_detailed instead')
            else
              Fog::Logger.deprecation('Calling OpenStack[:volume].list_snapshots(false) is deprecated, use .list_snapshots({}) instead')
            end
            path  = options ? 'snapshots/detail' : 'snapshots'
            query = options_deprecated
          end

          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => path,
            :query    => query
          )
        end
      end

      module Mock
        def list_snapshots(detailed=true, options={})
          response = Excon::Response.new
          response.status = 200
          response.body = {
            'snapshots' => [get_snapshot_details.body["snapshot"]]
          }
          response
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.9 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.8 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.7 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.6 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.5 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/volume/list_snapshots.rb
fog-1.37.0 lib/fog/openstack/requests/volume/list_snapshots.rb