Skip to main content

Cancelling a Scan

The API client can cancel a scan in progress. The scan can be canceled while waiting in the queue or during a scan.

cxSDKProxy.CancelScan Method

public CxWSBasicRepsonse CancelScan(
   string sessionID,
   string scanRunID,
);

Parameters

Return Value

If there are any errors, the return value parameter “CxWSBasicRepsonse.IsSuccesfull” is set to false and the second parameter “CxWSBasicRepsonse.ErrorMessage” indicates the reason for failure.

Example

To cancel a scan:

internal void Main(string [] args)
{
    String sessionID = args[0];
    CxSDKWebService cxSDKProxy = new CxSDKWebService();

   //the scan unique run id 
   string scanRunID = "d95d56a2-2d8c-4e61-8146-0822213549f8";

   //cancel the scan
   CxWSBasicRepsonse response = cxSDKProxy.CancelScan(sessionID, scanRunID);
 }

SOAP to REST Mapping

This section covers SOAP to REST migration and mapping of our legacy SOAP based SDK to the new REST APIs. It is recommended to use this reference only once CxSAST V8.8.0 is installed.

CancelScan

PATCH /sast/scansQueue/{id}

Cancel a specific scan while still in the queue. Parameters include - status (cancelled).

For more mapping information, refer to API Mapping (SOAP to REST). You can also find a summary of our REST APIs here.