Skip to content

delete_pull_through_cache_rule

delete_pull_through_cache_rule(
    ecr_repository_prefix: PullThroughCacheRuleRepositoryPrefix,
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional[RegistryId] = None,
) -> DeletePullThroughCacheRuleResponse

Deletes a pull through cache rule.

Parameters:

  • ecr_repository_prefix (PullThroughCacheRuleRepositoryPrefix) –

    The Amazon ECR repository prefix associated with the pull through cache rule to delete.

  • registry_id (Optional[RegistryId], default: None ) –

    The Amazon Web Services account ID associated with the registry that contains the pull through cache rule. If you do not specify a registry, the default registry is assumed.

Raises:

Source code in docs_src/capo_ecr/_services/ecr.py
def delete_pull_through_cache_rule(
    self,
    ecr_repository_prefix: "capo_ecr.types.pull_through_cache_rule_repository_prefix.PullThroughCacheRuleRepositoryPrefix",
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional["capo_ecr.types.registry_id.RegistryId"] = None,
) -> "capo_ecr.types.delete_pull_through_cache_rule_response.DeletePullThroughCacheRuleResponse":
    """<p>Deletes a pull through cache rule.</p>

    Args:
        ecr_repository_prefix: <p>The Amazon ECR repository prefix associated with the pull through cache rule to delete.</p>
        registry_id: <p>The Amazon Web Services account ID associated with the registry that contains the pull through cache rule. If you do not specify a registry, the default registry is assumed.</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.pull_through_cache_rule_not_found_exception.PullThroughCacheRuleNotFoundException: <p>The pull through cache rule was not found. Specify a valid pull through cache rule and try again.</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.delete_pull_through_cache_rule_request.DeletePullThroughCacheRuleRequest]",
    ) -> OperationResponse[
        "capo_ecr.types.delete_pull_through_cache_rule_response.DeletePullThroughCacheRuleResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.delete_pull_through_cache_rule

        output, http_response = (
            capo_ecr._operations.amazon_ec2_container_registry_v20150921.delete_pull_through_cache_rule.delete_pull_through_cache_rule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeletePullThroughCacheRule")
    )
    input_: capo_ecr.types.delete_pull_through_cache_rule_request.DeletePullThroughCacheRuleRequest = {
        "ecr_repository_prefix": ecr_repository_prefix
    }
    if registry_id is not None:
        input_["registry_id"] = registry_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output