ClamScanner
6 functions, invoked through the cpanel_uapi tool.
cpanel_uapi(service_id, module="ClamScanner", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.check_disinfection_status GET#
Request disinfection process status
This function checks the status of the previously queued disinfection of infected files.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
If you want to display the progress, you can render the ClamScanner::check_disinfection_status returned 'result{data}{details}' array where the type is step.
Each step record indicates the action taken on a specific file in the set being processed.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
disinfect_files POST#
Start disinfecting files with viruses
This function applies the disinfection option selected by the user for each infected file.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
get_scan_paths GET#
Return virus scan types
This function gets the available local paths that a cPanel account is permitted to scan.
Note:
The system determines the available scan types based on what the system administrator has set in WHM's Configure ClamAV® page.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
get_scan_status GET#
Request virus scan status
This function gets the status of a ClamAV® scan on a directory.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
list_infected_files GET#
Return infected file list
This function lists infected files from a ClamAV® virus scan.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
start_scan GET#
Start virus scan
This function starts a ClamAV® scan on a directory.
Note:
You must run the APIs in this order:
1. Run ClamScanner::start_scan to start the virus scan. 2. Run ClamScanner::get_scan_status in a loop until the scan is finished. 3. Run ClamScanner::list_infected_files to get a report of the complete list of infected files. 4. Decide how you want to handle each infected file. 5. Run ClamScanner::disinfect_files to queue the disinfection of the files. 6. Run ClamScanner::check_disinfection_status in a loop until you get a done status.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.