Skip to content

put_registry_scanning_configuration async

put_registry_scanning_configuration(
    *,
    config_overrides: Optional[AsyncECRClientConfig] = None,
    scan_type: Optional[ScanType] = None,
    rules: Optional[RegistryScanningRuleList] = None,
) -> PutRegistryScanningConfigurationResponse

Creates or updates the scanning configuration for your private registry.

Parameters:

  • scan_type (Optional[ScanType], default: None ) –

    The scanning type to set for the registry.

    When a registry scanning configuration is not defined, by default the BASIC scan type is used. When basic scanning is used, you may specify filters to determine which individual repositories, or all repositories, are scanned when new images are pushed to those repositories. Alternatively, you can do manual scans of images with basic scanning.

    When the ENHANCED scan type is set, Amazon Inspector provides automated vulnerability scanning. You may choose between continuous scanning or scan on push and you may specify filters to determine which individual repositories, or all repositories, are scanned.

  • rules (Optional[RegistryScanningRuleList], default: None ) –

    The scanning rules to use for the registry. A scanning rule is used to determine which repository filters are used and at what frequency scanning will occur.

Raises:

Source code in docs_src/capo_ecr/_services/async_ecr.py
async def put_registry_scanning_configuration(
    self,
    *,
    config_overrides: Optional[AsyncECRClientConfig] = None,
    scan_type: Optional["capo_ecr.types.scan_type.ScanType"] = None,
    rules: Optional[
        "capo_ecr.types.registry_scanning_rule_list.RegistryScanningRuleList"
    ] = None,
) -> "capo_ecr.types.put_registry_scanning_configuration_response.PutRegistryScanningConfigurationResponse":
    """<p>Creates or updates the scanning configuration for your private registry.</p>

    Args:
        scan_type: <p>The scanning type to set for the registry.</p> <p>When a registry scanning configuration is not defined, by default the <code>BASIC</code> scan type is used. When basic scanning is used, you may specify filters to determine which individual repositories, or all repositories, are scanned when new images are pushed to those repositories. Alternatively, you can do manual scans of images with basic scanning.</p> <p>When the <code>ENHANCED</code> scan type is set, Amazon Inspector provides automated vulnerability scanning. You may choose between continuous scanning or scan on push and you may specify filters to determine which individual repositories, or all repositories, are scanned.</p>
        rules: <p>The scanning rules to use for the registry. A scanning rule is used to determine which repository filters are used and at what frequency scanning will occur.</p>

    Raises:
        capo_ecr.errors.blocked_by_organization_policy_exception.BlockedByOrganizationPolicyException: <p>The operation did not succeed because the account is managed by a organization policy.</p>
        capo_ecr.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr.errors.validation_exception.ValidationException: <p>There was an exception validating this request.</p>
        capo_ecr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecr.types.put_registry_scanning_configuration_request.PutRegistryScanningConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecr.types.put_registry_scanning_configuration_response.PutRegistryScanningConfigurationResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_registry_scanning_configuration

        (
            output,
            http_response,
        ) = await capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_registry_scanning_configuration.async_put_registry_scanning_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutRegistryScanningConfiguration")
    )
    input_: capo_ecr.types.put_registry_scanning_configuration_request.PutRegistryScanningConfigurationRequest = {}
    if scan_type is not None:
        input_["scan_type"] = scan_type
    if rules is not None:
        input_["rules"] = rules

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output