Scans
Soda Cloud API Scan Endpoints
This endpoint enables you to execute a scan that has been defined within Soda Cloud and which runs on a Soda Agent connected to the account. Call this endpoint from within your data pipeline to programmatically execute scans from outside the Soda Cloud environment.
This POST uses the following parameters to provide specific details:
scanDefinition
: Supply a string value to specify the scan definition in Soda Cloud. To retrieve this value, navigate to the Scans page in Soda Cloud, then select the scan definition you wish to execute remotely and copy the scan name, which is the smaller text under the label. For example,weekday_scan_schedule
. The scan definition must be connected to a Soda Agent in order to execute a scan remotely, not Soda Library.dataTimestamp
: (Optional) Supply a value to indicate a specific timestamp for the scan for Soda Cloud. For example, provide a time in the past so that although Soda executes the scan when you call the endpoint, it timestamps the scan with the value you provide so that it appears in the user interface with your supplied timestamp value, not the time at which it actually executed the scan. Supply an ISO8601 timestamp value such as:2023-12-31T10:15:30+01:00
. If you do not specify a value, Soda uses the current moment to timestamp the scan.
The Response of this call, when successful, is 201
and contains headers Location
and X-Soda-Scan-Id
which identify the executed scan. Use the value of X-Soda-Scan-Id
in the scanId
parameter of the Get scan status, Get scan logs, and Cancel a scan endpoints.
Authentication
User authentication required: true
This endpoint enforces authentication using the API keys you provide in the Basic
authentication header.
Authorization
Any Soda Cloud user in your organization may execute this query.
Tags
Scans
Rate limiting
10 requests/60 seconds
POST /api/v1/scans HTTP/1.1
Host: cloud.soda.io
Authorization: Basic username:password
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 48
"dataTimestamp='text'&scanDefinition='text'"
No content
This endpoint enables you to check on the state of a scan that you executed using the Trigger a scan endpoint. Call this endpoint to monitor the status of a scan during its execution.
If you wish to access the logs of a completed scan, use the Get scan logs endpoint.
This POST uses the following parameter to provide specific details:
scanId
: Use the value ofX-Soda-Scan-Id
returned as part of the201
response when you called the Trigger a scan endpoint.
As a scan executes, you can call this endpoint to progressively collect values based on the state of the scan. Refer to the list below for the states that calls to this endpoint return.
queuing
: The scan is in the queue for execution, awaiting a pick-up from a Soda Agent.executing
: A Soda Agent has picked up the scan and is executing.cancelationRequested
: An entity requested cancelation of this scan and the request is awaiting pick-up from the Soda Agent responsible for the scan.timeOutRequested
: A time out has been detected, and an automatic request to stop the scan execution is awaiting pick-up from the Soda Agent responsible for the scan.canceled
: A Soda Agent confirmed that the scan has been cancelled. This is the final state of the scan.timedOut
: A Soda Agent confirmed that the scan has timed-out. This is the final state of the scan.failed
: The scan did not start, or it did not successfully complete because of an unexpected cause. This is the final state of the scan.completedWithErrors
: The scan completed successfully, but there were errors involving some of the checks in the scan. This is the final state of the scan.completedWithFailures
: The scan completed successfully and reveals failed results for some checks. This is the final state of the scan.completedWithWarnings
: The scan completed successfully and reveals warning results for some checks. This is the final state of the scan.completed
: The scan completed successfully and reveals passing results for all checks. This is a final state of a scan
To get the logs of the completed scan, please use API /api/v1/scans/{scanId}/logs
.
Authentication
User authentication required: true
This endpoint enforces authentication using the API keys you provide in the Basic
authentication header.
Authorization
Any Soda Cloud user in your organization may execute this query.
Tags
Scans
Rate limiting
60 requests/60 seconds
GET /api/v1/scans/{scanId} HTTP/1.1
Host: cloud.soda.io
Authorization: Basic username:password
Accept: */*
{
"agentId": "text",
"checks": [
{
"evaluationStatus": "pass",
"id": "text"
}
],
"cloudUrl": "text",
"contractDatasetCloudUrl": "text",
"created": "text",
"ended": "text",
"errors": 1,
"failures": 1,
"id": "text",
"scanDefinition": {
"id": "text",
"name": "text"
},
"scanTime": "text",
"started": "text",
"state": "queuing",
"submitted": "text",
"warnings": 1
}
This endpoint enables you to cancel a scan.
Depending on the state of the scan when you call this endpoint, the response returns one of the following:
Where the state is
pending
, Soda immediately changes the state tocanceled
.Where the state is
submitted
, Soda immediately changes the state tocancelationRequested
. - Where the scan is in any other state, the endpoint returns a400
(Bad request) response.
This DELETE uses the following parameters to provide specific details:
scanId
: Use the value ofX-Soda-Scan-Id
returned as part of the201
response when you called the Trigger a scan endpoint.
Authentication
User authentication required: true
This endpoint enforces authentication using the API keys you provide in the Basic
authentication header.
Authorization
Any Soda Cloud user in your organization may execute this query.
Tags
Scans
Rate limiting
10 requests/60 seconds
DELETE /api/v1/scans/{scanId} HTTP/1.1
Host: cloud.soda.io
Authorization: Basic username:password
Accept: */*
No content
This endpoint enables you to gather log details about the final state of a scan you executed using the Trigger a scan endpoint. Use this endpoint to study scan logs to investigate issues with its execution.
If you wish to access the state of a scan in progress, use the Get scan status endpoint.
This GET is a paginated API that uses the following parameters to request specific details:
scanId
: Use the value ofX-Soda-Scan-Id
returned as part of the201
response when you called the Trigger a scan endpoint.size
: Supply an integer value between 100 and 1000, inclusive. The default value is 1000.page
: Supply an integer value. The default value is 0.
The response sorts the the log information by creation timestamp in ascending order.
Authentication
User authentication required: true
This endpoint enforces authentication using the API keys you provide in the Basic
authentication header.
Authorization
Any Soda Cloud user in your organization may execute this query.
Tags
Scans
Rate limiting
60 requests/60 seconds
GET /api/v1/scans/{scanId}/logs HTTP/1.1
Host: cloud.soda.io
Authorization: Basic username:password
Accept: */*
{
"content": [
{
"index": 1,
"level": "debug",
"message": "text",
"timestamp": "text"
}
],
"first": true,
"last": true,
"number": 1,
"size": 1,
"totalElements": 1,
"totalPages": 1
}
Was this helpful?