The PutImageScanningConfiguration API is being deprecated, in favor of specifying the image scanning configuration at the registry level. For more information, see PutRegistryScanningConfiguration.
Updates the image scanning configuration for the specified repository.
Parameters:
-
registry_id
(Optional[RegistryId], default:
None
)
–
The Amazon Web Services account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.
-
repository_name
(RepositoryName)
–
The name of the repository in which to update the image scanning configuration setting.
-
image_scanning_configuration
(ImageScanningConfiguration)
–
The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.
Raises:
-
InvalidParameterException
–
The specified parameter is invalid. Review the available parameters for the API request.
-
RepositoryNotFoundException
–
The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.
-
ServerException
–
These errors are usually caused by a server-side issue.
-
ValidationException
–
There was an exception validating this request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_ecr/_services/async_ecr.py
| async def put_image_scanning_configuration(
self,
repository_name: "capo_ecr.types.repository_name.RepositoryName",
image_scanning_configuration: "capo_ecr.types.image_scanning_configuration.ImageScanningConfiguration",
*,
config_overrides: Optional[AsyncECRClientConfig] = None,
registry_id: Optional["capo_ecr.types.registry_id.RegistryId"] = None,
) -> "capo_ecr.types.put_image_scanning_configuration_response.PutImageScanningConfigurationResponse":
"""<important> <p>The <code>PutImageScanningConfiguration</code> API is being deprecated, in favor of specifying the image scanning configuration at the registry level. For more information, see <a>PutRegistryScanningConfiguration</a>.</p> </important> <p>Updates the image scanning configuration for the specified repository.</p>
Args:
registry_id: <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.</p>
repository_name: <p>The name of the repository in which to update the image scanning configuration setting.</p>
image_scanning_configuration: <p>The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
Raises:
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.repository_not_found_exception.RepositoryNotFoundException: <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</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_image_scanning_configuration_request.PutImageScanningConfigurationRequest]",
) -> AsyncOperationResponse[
"capo_ecr.types.put_image_scanning_configuration_response.PutImageScanningConfigurationResponse"
]:
import capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_image_scanning_configuration
(
output,
http_response,
) = await capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_image_scanning_configuration.async_put_image_scanning_configuration(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutImageScanningConfiguration")
)
input_: capo_ecr.types.put_image_scanning_configuration_request.PutImageScanningConfigurationRequest = {
"repository_name": repository_name,
"image_scanning_configuration": image_scanning_configuration,
}
if registry_id is not None:
input_["registry_id"] = registry_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|