def list_vuln_exceptions(status = nil)
      unless is_valid_vuln_exception_status?(status)
        raise "Unknown Status ~> '#{status}' :: For available options refer to Nexpose::VulnException::Status"
      end

      status = Nexpose::VulnException::Status.const_get(status_string_to_constant(status)) unless status.nil?

      results = []
      ajax_data = []

      url_size = 500
      url_page = 0

      req = Nexpose::AJAX.get(self, "/api/3/vulnerability_exceptions?size=#{url_size}&page=#{url_page}")
      data = JSON.parse(req, object_class: OpenStruct)
      ajax_data << data.resources

      if data.links.count > 1
        loop do
          url_page += 1
          req = Nexpose::AJAX.get(self, "/api/3/vulnerability_exceptions?size=#{url_size}&page=#{url_page}")
          data = JSON.parse(req, object_class: OpenStruct)
          ajax_data << data.resources
          links = data.links.select { |ll| ['self', 'last'].include?(ll.rel) }
          break if links[0].href == links[1].href
        end
      end

      ajax_data.compact!
      ajax_data.flatten!

      ajax_data.each do |vuln_excep|
        ve = VulnException.new(vuln_excep.scope.vulnerabilityID, vuln_excep.scope.type, vuln_excep.submit.reason, vuln_excep.state)
        ve.id                = vuln_excep.id
        ve.submitter         = vuln_excep.submit.name
        ve.submitter_comment = vuln_excep.submit.comment
        ve.submit_date       = Time.parse(vuln_excep.submit.date) unless vuln_excep.submit.date.nil?
        ve.asset_id          = vuln_excep.scope.assetID
        ve.site_id           = vuln_excep.scope.siteID
        ve.asset_group_id    = vuln_excep.scope.assetGroupID
        ve.port              = vuln_excep.scope.port
        ve.vuln_key          = vuln_excep.scope.key
        ve.expiration        = Time.parse(vuln_excep.expires) unless vuln_excep.expires.nil?
        unless vuln_excep.review.nil?
          ve.reviewer          = vuln_excep.review.name
          ve.reviewer_comment  = vuln_excep.review.comment
          ve.review_date       = Time.parse(vuln_excep.review.date) unless vuln_excep.review.date.nil?
        end
        results << ve
      end
      results.keep_if { |v| v.status == status } unless status.nil?
      results
    end
def list_vuln_exceptions(status = nil)
      unless is_valid_vuln_exception_status?(status)
        raise "Unknown Status ~> '#{status}' :: For available options refer to Nexpose::VulnException::Status"
      end

      status = Nexpose::VulnException::Status.const_get(status_string_to_constant(status)) unless status.nil?

      results = []
      ajax_data = []

      url_size = 500
      url_page = 0

      req = Nexpose::AJAX.get(self, "/api/3/vulnerability_exceptions?size=#{url_size}&page=#{url_page}")
      data = JSON.parse(req, object_class: OpenStruct)
      ajax_data << data.resources

      if data.links.count > 1
        loop do
          url_page += 1
          req = Nexpose::AJAX.get(self, "/api/3/vulnerability_exceptions?size=#{url_size}&page=#{url_page}")
          data = JSON.parse(req, object_class: OpenStruct)
          ajax_data << data.resources
          links = data.links.select { |ll| ['self', 'last'].include?(ll.rel) }
          break if links[0].href == links[1].href
        end
      end

      ajax_data.compact!
      ajax_data.flatten!

      ajax_data.each do |vuln_excep|
        ve = VulnException.new(vuln_excep.scope.vulnerabilityID, vuln_excep.scope.type, vuln_excep.submit.reason, vuln_excep.state)
        ve.id                = vuln_excep.id
        ve.submitter         = vuln_excep.submit.name
        ve.submitter_comment = vuln_excep.submit.comment
        ve.submit_date       = Time.parse(vuln_excep.submit.date) unless vuln_excep.submit.date.nil?
        ve.asset_id          = vuln_excep.scope.assetID
        ve.site_id           = vuln_excep.scope.siteID
        ve.asset_group_id    = vuln_excep.scope.assetGroupID
        ve.port              = vuln_excep.scope.port
        ve.vuln_key          = vuln_excep.scope.key
        ve.expiration        = Time.parse(vuln_excep.expires) unless vuln_excep.expires.nil?
        unless vuln_excep.review.nil?
          ve.reviewer          = vuln_excep.review.name
          ve.reviewer_comment  = vuln_excep.review.comment
          ve.review_date       = Time.parse(vuln_excep.review.date) unless vuln_excep.review.date.nil?
        end
        results << ve
      end
      results.keep_if { |v| v.status == status } unless status.nil?
      results
    end
Retrieve all active vulnerability exceptions.

 @param [String] status Filter exceptions by the current status.
   @see Nexpose::VulnException::Status
 @return [Array[VulnException]] List of matching vulnerability exceptions.