create_code_scan
async
¶
create_code_scan(
environment_id: EnvironmentId,
*,
config_overrides: Optional[AsyncContinuumClientConfig] = None,
client_token: Optional[ScanClientToken] = None,
) -> CreateCodeScanOutput
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.
Parameters:
-
environment_id(EnvironmentId) –Environment to scan.
-
client_token(Optional[ScanClientToken], default:None) –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.
Raises:
-
AccessDeniedException–The request is not authorized. Verify that your credentials and request signature are valid and that you have permission to perform this action.
-
ConflictException–The request could not be completed due to a conflict with the current state of the resource.
-
InternalServerException–The request couldn't be processed because of an internal server issue. Try again later. If the problem persists, contact AWS Support.
-
ResourceNotFoundException–The specified resource was not found. Verify that the resource identifier is correct and that the resource exists.
-
ServiceQuotaExceededException–The request would exceed a service quota. Review your quota and request an increase if needed.
-
ThrottlingException–The request was denied due to request throttling.
-
UnknownServiceError–The service returned an error code this client does not model.