Adds an IAM principal to the pull time update exclusion list for a registry. Amazon ECR will not record the pull time if an excluded principal pulls an image.
Parameters:
-
principal_arn
(PrincipalArn)
–
The ARN of the IAM principal to exclude from having image pull times recorded.
Raises:
Source code in docs_src/capo_ecr/_services/ecr.py
| def register_pull_time_update_exclusion(
self,
principal_arn: "capo_ecr.types.principal_arn.PrincipalArn",
*,
config_overrides: Optional[ECRClientConfig] = None,
) -> "capo_ecr.types.register_pull_time_update_exclusion_response.RegisterPullTimeUpdateExclusionResponse":
"""<p>Adds an IAM principal to the pull time update exclusion list for a registry. Amazon ECR will not record the pull time if an excluded principal pulls an image.</p>
Args:
principal_arn: <p>The ARN of the IAM principal to exclude from having image pull times recorded.</p>
Raises:
capo_ecr.errors.exclusion_already_exists_exception.ExclusionAlreadyExistsException: <p>The specified pull time update exclusion already exists for the registry.</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.limit_exceeded_exception.LimitExceededException: <p>The operation did not succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR service quotas</a> in the Amazon Elastic Container Registry User Guide.</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.
"""
def _handler(
req: "OperationRequest[capo_ecr.types.register_pull_time_update_exclusion_request.RegisterPullTimeUpdateExclusionRequest]",
) -> OperationResponse[
"capo_ecr.types.register_pull_time_update_exclusion_response.RegisterPullTimeUpdateExclusionResponse"
]:
import capo_ecr._operations.amazon_ec2_container_registry_v20150921.register_pull_time_update_exclusion
output, http_response = (
capo_ecr._operations.amazon_ec2_container_registry_v20150921.register_pull_time_update_exclusion.register_pull_time_update_exclusion(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RegisterPullTimeUpdateExclusion")
)
input_: capo_ecr.types.register_pull_time_update_exclusion_request.RegisterPullTimeUpdateExclusionRequest = {
"principal_arn": principal_arn
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|