:doc:`ECR <../../ecr>` / Client / validate_pull_through_cache_rule

********************************
validate_pull_through_cache_rule
********************************



.. py:method:: ECR.Client.validate_pull_through_cache_rule(**kwargs)

  

  Validates an existing pull through cache rule for an upstream registry that requires authentication. This will retrieve the contents of the Amazon Web Services Secrets Manager secret, verify the syntax, and then validate that authentication to the upstream registry is successful.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ValidatePullThroughCacheRule>`_  


  **Request Syntax**
  ::

    response = client.validate_pull_through_cache_rule(
        ecrRepositoryPrefix='string',
        registryId='string'
    )
    
  :type ecrRepositoryPrefix: string
  :param ecrRepositoryPrefix: **[REQUIRED]** 

    The repository name prefix associated with the pull through cache rule.

    

  
  :type registryId: string
  :param registryId: 

    The registry ID associated with the pull through cache rule. If you do not specify a registry, the default registry is assumed.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ecrRepositoryPrefix': 'string',
          'registryId': 'string',
          'upstreamRegistryUrl': 'string',
          'credentialArn': 'string',
          'customRoleArn': 'string',
          'upstreamRepositoryPrefix': 'string',
          'isValid': True|False,
          'failure': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ecrRepositoryPrefix** *(string) --* 

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

        
      

      - **registryId** *(string) --* 

        The registry ID associated with the request.

        
      

      - **upstreamRegistryUrl** *(string) --* 

        The upstream registry URL associated with the pull through cache rule.

        
      

      - **credentialArn** *(string) --* 

        The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret associated with the pull through cache rule.

        
      

      - **customRoleArn** *(string) --* 

        The ARN of the IAM role associated with the pull through cache rule.

        
      

      - **upstreamRepositoryPrefix** *(string) --* 

        The upstream repository prefix associated with the pull through cache rule.

        
      

      - **isValid** *(boolean) --* 

        Whether or not the pull through cache rule was validated. If ``true``, Amazon ECR was able to reach the upstream registry and authentication was successful. If ``false``, there was an issue and validation failed. The ``failure`` reason indicates the cause.

        
      

      - **failure** *(string) --* 

        The reason the validation failed. For more details about possible causes and how to address them, see `Using pull through cache rules <https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html>`__ in the *Amazon Elastic Container Registry User Guide*.

        
  
  **Exceptions**
  
  *   :py:class:`ECR.Client.exceptions.ServerException`

  
  *   :py:class:`ECR.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`ECR.Client.exceptions.ValidationException`

  
  *   :py:class:`ECR.Client.exceptions.PullThroughCacheRuleNotFoundException`

  