GetScan - Amazon CodeGuru Security

GetScan

Returns details about a scan, including whether or not a scan has completed.

Request Syntax

GET /scans/scanName?runId=runId HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

runId

UUID that identifies the individual scan run you want to view details about. You retrieve this when you call the CreateScan operation. Defaults to the latest scan run if missing.

Pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$

scanName

The name of the scan you want to view details about.

Length Constraints: Minimum length of 1. Maximum length of 140.

Pattern: ^[a-zA-Z0-9-_$:.]*$

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "analysisType": "string", "createdAt": number, "errorMessage": "string", "numberOfRevisions": number, "runId": "string", "scanName": "string", "scanNameArn": "string", "scanState": "string", "updatedAt": number }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

analysisType

The type of analysis CodeGuru Security performed in the scan, either Security or All. The Security type only generates findings related to security. The All type generates both security findings and quality findings.

Type: String

Valid Values: Security | All

createdAt

The time the scan was created.

Type: Timestamp

errorMessage

Details about the error that causes a scan to fail to be retrieved.

Type: String

Length Constraints: Minimum length of 1.

numberOfRevisions

The number of times a scan has been re-run on a revised resource.

Type: Long

runId

UUID that identifies the individual scan run.

Type: String

Pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$

scanName

The name of the scan.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 140.

Pattern: ^[a-zA-Z0-9-_$:.]*$

scanNameArn

The ARN for the scan name.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

Pattern: ^arn:aws:codeguru-security:[\S]+:[\d]{12}:scans\/[a-zA-Z0-9-_$:.]*$

scanState

The current state of the scan. Returns either InProgress, Successful, or Failed.

Type: String

Valid Values: InProgress | Successful | Failed

updatedAt

The time when the scan was last updated. Only available for STANDARD scan types.

Type: Timestamp

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500

ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: