/connmgr/v1/scan/<connection_name>: PUT

Stops a scan.

The /connmgr/v1/scan/<connection_name>: PUT endpoint stops a running scan. Only an Data Cataloging user with data admin role or collection admin role can stop a scan. The following table shows which roles can access this REST API endpoint:
Table 1. Access by role
Data admin Data user Collection Admin Admin Service user
Χ 1 Χ Χ
1 Collection Admin user can start, stop, and get the status of the scans that are applied to the collections to which they have the Collection Admin role assigned.

Synopsis of the request URL

curl -k -H “Authorization: Bearer <token>” -X PUT 
https://<spectrum_discover_host>/connmgr/v1/scan/<connection_name>/stop 

Supported request types, input fields, and response formats

Supported request types:
  • POST
Supported response formats:
  • JSON

Examples

Follow these steps to stop a scan:

  1. Obtain an auth token by using the credentials of the data admin user as shown:
    curl -k https://<spectrum_discover_host>/auth/v1/token 
    -u “<user_name>:<password>

    For a valid user, the auth token is returned in the X-Auth-Token response header.

  2. Stop the scan using the following request:
    curl -k -H “Authorization: Bearer <token>” -X PUT 
    https://<spectrum_discover_host>/connmgr/v1/scan/sdconnection/stop

Response

The following table displays the common response statuses:
Table 2. Common response statuses
Status code Message Description
400 Must specify a connection name for the scan endpoint. Connection name in the URL is not specified.

Must specify an action for the scan endpoint.

Available action endpoints are: /pause, /resume, and /stop.
The stop action is not specified in the URL.
No scan is currently in progress for <connection_name>. No scans currently in progress for the given connection.

Unsupported action <action specified in url>.

Unsupported action specified.
404 Could not locate connection document for <connection_name>. Connection with the given name does not exist.
403 User does not have permission to control connection. User does not have access to the collection to which the connection belongs.
200 - Scan successfully stopped.
Note: A user with a collection admin role can only stop a scan for a connection if an associated collection is set, and if it is a collection the collection admin user administers.
A successful scan displays the following response:
“Status”: “Stop of sdconnection scan submitted.”
The following displays an error response example:
“Status”: “No scan is currently in progress for sdconnection.”