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
fog-1.37.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.36.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.35.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.34.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.33.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.32.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.31.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.30.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.29.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.28.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.27.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.26.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.25.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute_v2/get_console_output.rb
fog-1.24.0 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute_v2/get_console_output.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute_v2/get_console_output.rb