putRegistryScanningConfiguration method
- List<
RegistryScanningRule> ? rules, - ScanType? scanType,
Creates or updates the scanning configuration for your private registry.
May throw BlockedByOrganizationPolicyException.
May throw InvalidParameterException.
May throw ServerException.
May throw ValidationException.
Parameter rules :
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.
Parameter scanType :
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.
Implementation
Future<PutRegistryScanningConfigurationResponse>
putRegistryScanningConfiguration({
List<RegistryScanningRule>? rules,
ScanType? scanType,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerRegistry_V20150921.PutRegistryScanningConfiguration'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (rules != null) 'rules': rules,
if (scanType != null) 'scanType': scanType.value,
},
);
return PutRegistryScanningConfigurationResponse.fromJson(jsonResponse.body);
}