/connmgr/v1/scan/<connection_name>: GET
Gets the current scan status of a single connection.
The /connmgr/v1/scan/<connection_name>: GET endpoint gets the current scan
status of a single connection. Only an Data Cataloging
user with data admin role or collection admin role can get the status of a scan. The following table
shows which roles can access this REST API endpoint:
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 GET
https://<spectrum_discover_host>/connmgr/v1/scan/<connection_name>
Supported request types, input fields, and response formats
Supported request types:
Supported response formats:- POST
- JSON
Examples
Follow these steps to get the scan status of a connection:
- 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. - Get the scan status of a connection with name
sdconnection
using the following request:curl -k -H “Authorization: Bearer <token>” -X GET https://<spectrum_discover_host>/connmgr/v1/scan/sdconnection
Response
The following table displays the common response statuses:
Status code | Message | Description |
---|---|---|
200 | Scan status JSON. | Scan status successfully retrieved. |
Note: A user with a collection admin role can only get the scan status for a connection if an
associated collection is set, and if it is a collection the collection admin user administers.
Therefore, in the response, a collection admin user is only presented with the status of connections
that belong to the connections the collection admin user administers.
A successful scan displays the following
response:
[
{
"Name":"sdconnection",
"status":"Running",
"message":"Crawling NFS mount",
"Phase":2,
"Total_phases":3
},
{
"Name":"ss",
"status":"Running",
"message":"Preparing to scan connection",
"Phase":1,
"total_phases":4
}
]