Sha256: a87b6164a261c4242ee51fa5b8fa5795f66f39bb55075827c9f3b7d000c4a5bb

Contents?: true

Size: 1.15 KB

Versions: 29

Compression:

Stored size: 1.15 KB

Contents

module Fog
  module Compute
    class HPV2
      class Real
        # Retrieve console output for specified instance
        #
        # ==== Parameters
        # * 'server_id'<~Stribng> - UUId 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'].find {|_| _['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::HPV2::NotFound
          end
          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/compute_v2/get_console_output.rb
ns-fog-1.22.8 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.7 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.6 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.23.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.4 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.3 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.2 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.22.1 lib/fog/hp/requests/compute_v2/get_console_output.rb