Sha256: b00fe5a13434a81917edc1399e6e66ee67da1165abce9bcf8dbf8c89c3dc2d1f

Contents?: true

Size: 1.49 KB

Versions: 33

Compression:

Stored size: 1.49 KB

Contents

module Fog
  module AWS
    module EC2
      class Real

        require 'fog/aws/parsers/ec2/get_console_output'

        # Retrieve console output for specified instance
        #
        # ==== Parameters
        # * instance_id<~String> - Id of instance to get console output from
        #
        # ==== Returns
        # # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'instanceId'<~String> - Id of instance
        #     * 'output'<~String> - Console output
        #     * 'requestId'<~String> - Id of request
        #     * 'timestamp'<~Time> - Timestamp of last update to output
        def get_console_output(instance_id)
          request(
            'Action'      => 'GetConsoleOutput',
            'InstanceId'  => instance_id,
            :idempotent   => true,
            :parser       => Fog::Parsers::AWS::EC2::GetConsoleOutput.new
          )
        end

      end

      class Mock

        def get_console_output(instance_id)
          response = Excon::Response.new
          if instance = @data[:instances][instance_id]
            response.status = 200
            response.body = {
              'instanceId'    => instance_id,
              'output'        => nil,
              'requestId'     => Fog::AWS::Mock.request_id,
              'timestamp'     => Time.now
            }
            response
          else;
            raise Fog::AWS::EC2::NotFound.new("The instance ID '#{instance_id}' does not exist")
          end
        end

      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.28 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.27 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.26 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.25 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.24 lib/fog/aws/requests/ec2/get_console_output.rb
tecnh-fog-0.2.23.vpc lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.23 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.22 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.21 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.20 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.19 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.18 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.17 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.16 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.15 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.14 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.13 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.12 lib/fog/aws/requests/ec2/get_console_output.rb
fog-0.2.11 lib/fog/aws/requests/ec2/get_console_output.rb