Sha256: 5b0c1351578229b88d4ed7954c1e7c16215e5f4b28295795dbe264ff7eb63170

Contents?: true

Size: 1.58 KB

Versions: 39

Compression:

Stored size: 1.58 KB

Contents

module Fog
  module Compute
    class Rackspace
      class Real
        # List all servers details
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'servers'<~Array>:
        #     * 'id'<~Integer> - Id of server
        #     * 'name<~String> - Name of server
        #     * 'imageId'<~Integer> - Id of image used to boot server
        #     * 'flavorId'<~Integer> - Id of servers current flavor
        #     * 'hostId'<~String>
        #     * 'status'<~String> - Current server status
        #     * 'progress'<~Integer> - Progress through current status
        #     * 'addresses'<~Hash>:
        #       * 'public'<~Array> - public address strings
        #       * 'private'<~Array> - private address strings
        #     * 'metadata'<~Hash> - metadata
        def list_servers_detail
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'servers/detail.json'
          )
        end
      end

      class Mock
        def list_servers_detail
          response = Excon::Response.new

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

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

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/requests/compute/list_servers_detail.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/compute/list_servers_detail.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/compute/list_servers_detail.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.5 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.4 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.3 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.2 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.1 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-rackspace-0.1.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.37.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.36.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.35.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-2.0.0.pre.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.34.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.33.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.32.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
fog-1.31.0 lib/fog/rackspace/requests/compute/list_servers_detail.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/rackspace/requests/compute/list_servers_detail.rb