Sha256: 2c76a545d2f76bbee99477f9bb452d263703d530ef1e50dbd562f7083f855396

Contents?: true

Size: 1.12 KB

Versions: 20

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module OpenStack
    class Compute
      class Real
        # Available filters: name, status, image, flavor, changes_since, reservation_id
        def list_servers_detail(options = {})
          params = options.dup
          if params[:all_tenants]
            params['all_tenants'] = 'True'
            params.delete(:all_tenants)
          end

          request(
            :expects => [200, 203],
            :method  => 'GET',
            :path    => 'servers/detail',
            :query   => params
          )
        end
      end

      class Mock
        def list_servers_detail(_filters = {})
          response = Excon::Response.new

          servers = data[:servers].values
          servers.each do |server|
            case server['status']
            when 'BUILD'
              if Time.now - data[:last_modified][:servers][server['id']] > Fog::Mock.delay * 2
                server['status'] = 'ACTIVE'
              end
            end
          end

          response.status = [200, 203][rand(2)]
          response.body = {'servers' => servers}
          response
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
fog-openstack-1.1.3 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.1.2 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-fork-99 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.1.0 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.1.0.pre lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.11 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.10 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.9 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.8 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.7 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.6 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.5 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.4 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.3 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.2 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.1 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-1.0.0 lib/fog/openstack/compute/requests/list_servers_detail.rb
fog-openstack-0.3.1 lib/fog/openstack/compute/requests/list_servers_detail.rb