Sha256: 3de761b3a5a6fd074b196c7a6854c50e6bc4b39483962b73ae33c0bfb6105dda

Contents?: true

Size: 1.21 KB

Versions: 24

Compression:

Stored size: 1.21 KB

Contents

module Fog
  module Compute
    class HP
      class Real

        require 'fog/aws/parsers/compute/get_console_output'

        # Retrieve console output for specified instance
        #
        # ==== Parameters
        # * server_id<~Integer> - Id of instance to get console output from
        # * num_lines<~Integer> - Number of lines of console output from the end
        # ==== Returns
        # # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'output'<~String> - Console output
        #
        def get_console_output(server_id, num_lines)
          body = { 'os-getConsoleOutput' => { 'length' => num_lines }}
          server_action(server_id, body, 200)
        end

      end

      class Mock

        def get_console_output(server_id, num_lines)
          output = ""
          response = Excon::Response.new
          if list_servers_detail.body['servers'].detect {|_| _['id'] == server_id}
            (1..num_lines).each {|i| output += "Console Output Line #{i} \r\n"}
            response.body = { 'output' => output }
            response.status = 200
          else
            raise Fog::Compute::HP::NotFound
          end
          response
        end

      end
    end
  end
end

Version data entries

24 entries across 24 versions & 6 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.17.0 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.16.0 lib/fog/hp/requests/compute/get_console_output.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/hp/requests/compute/get_console_output.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.15.0 lib/fog/hp/requests/compute/get_console_output.rb
gapinc-fog-1.14.0 lib/fog/hp/requests/compute/get_console_output.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.14.0 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.13.0 lib/fog/hp/requests/compute/get_console_output.rb
gapinc-fog-1.12.1.2 lib/fog/hp/requests/compute/get_console_output.rb
gapinc-fog-1.12.1.1 lib/fog/hp/requests/compute/get_console_output.rb
gapinc-fog-1.12.1a lib/fog/hp/requests/compute/get_console_output.rb
gapinc-fog-1.12.1 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.12.1 lib/fog/hp/requests/compute/get_console_output.rb
fog-1.12.0 lib/fog/hp/requests/compute/get_console_output.rb
hpfog-0.0.20 lib/fog/hp/requests/compute/get_console_output.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/hp/requests/compute/get_console_output.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/hp/requests/compute/get_console_output.rb
fog-1.11.1 lib/fog/hp/requests/compute/get_console_output.rb