def login
      login_hash = { 'sync-id' => 0, 'password' => @password, 'user-id' => @username, 'token' => @token }
      login_hash['silo-id'] = @silo_id if @silo_id
      r = execute(make_xml('LoginRequest', login_hash))
      if r.success
        @session_id = r.sid
        true
      end
    rescue APIError
      raise AuthenticationFailed.new(r)
    end
def login
      login_hash = { 'sync-id' => 0, 'password' => @password, 'user-id' => @username, 'token' => @token }
      login_hash['silo-id'] = @silo_id if @silo_id
      r = execute(make_xml('LoginRequest', login_hash))
      if r.success
        @session_id = r.sid
        true
      end
    rescue APIError
      raise AuthenticationFailed.new(r)
    end
A constructor for Connection

 @param [String] ip The IP address or hostname/FQDN of the Nexpose console.
 @param [String] user The username for Nexpose sessions.
 @param [String] pass The password for Nexpose sessions.
 @param [Fixnum] port The port number of the Nexpose console.
 @param [String] silo_id The silo identifier for Nexpose sessions.
 @param [String] token The two-factor authentication (2FA) token for Nexpose sessions.
 @param [String] trust_cert The PEM-formatted web certificate of the Nexpose console. Used for SSL validation.
 Establish a new connection and Session ID