Continuum / Client / create_code_scan

create_code_scan

Continuum.Client.create_code_scan(**kwargs)

Creates an explicit scan request for one environment. CP creates durable work before any queue delivery occurs.

Retrying a request that succeeded, with the same clientToken on the same environment, returns the original scan instead of starting another one. Token handling is not yet atomic: requests with the same token that run at the same time, or a retry after a request that failed partway through, can leave an additional scan, which may end in the FAILED state with a message that it was superseded. Deleting the environment makes its tokens unusable; a later request with one of them returns ResourceNotFoundException.

Each environment can have a limited number of scans in progress at the same time. Once that limit is enforced, a request that would exceed it returns ServiceQuotaExceededException; wait for a scan to finish (ListCodeScans shows each scan’s status), then retry.

See also: AWS API Documentation

Request Syntax

response = client.create_code_scan(
    environmentId='string',
    clientToken='string'
)
Parameters:
  • environmentId (string) –

    [REQUIRED]

    Environment to scan.

  • clientToken (string) –

    An optional token identifying one scan request for this environment. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request, so each request without a token starts a new scan. To retry a request after a lost response, supply the same token on the same environment; once a request with that token has succeeded, a retry returns the original scan. Concurrent requests with the same token, or a retry after a request that failed partway through, can leave an additional scan, which may end FAILED as superseded. A token is bound to its scan for as long as the service retains the scan’s build record, with no shorter expiry. Deleting the environment makes the binding inaccessible: a later request with the token returns ResourceNotFoundException.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'scan': {
        'scanRunId': 'string',
        'status': 'SUBMITTED'|'WAITING_FOR_BUILD'|'BUILDING'|'WAITING_FOR_SCAN'|'SCANNING'|'SUCCEEDED'|'FAILED',
        'origin': 'MANUAL'|'SCHEDULED',
        'createdAt': datetime(2015, 1, 1),
        'completedAt': datetime(2015, 1, 1),
        'failureMessage': 'string',
        'failureStage': 'SUBMITTED'|'WAITING_FOR_BUILD'|'BUILDING'|'WAITING_FOR_SCAN'|'SCANNING'
    }
}

Response Structure

  • (dict) –

    • scan (dict) –

      The scan run this request created, or the scan run a previous request with the same clientToken already accepted.

      • scanRunId (string) –

        The unique scan identifier.

      • status (string) –

        Current customer-visible status.

      • origin (string) –

        Why the scan was created. Always present.

      • createdAt (datetime) –

        Time at which Continuum accepted the scan request.

      • completedAt (datetime) –

        Time at which a terminal result was recorded.

      • failureMessage (string) –

        Failure detail present for unsuccessful scans.

      • failureStage (string) –

        Phase this scan failed in. Present only when status is FAILED, and absent for a scan that failed before this field existed.

Exceptions