:doc:`Glacier <../../glacier>` / Client / get_data_retrieval_policy

*************************
get_data_retrieval_policy
*************************



.. py:method:: Glacier.Client.get_data_retrieval_policy(**kwargs)

  

  This operation returns the current data retrieval policy for the account and region specified in the GET request. For more information about data retrieval policies, see `Amazon Glacier Data Retrieval Policies <https://docs.aws.amazon.com/amazonglacier/latest/dev/data-retrieval-policy.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/glacier-2012-06-01/GetDataRetrievalPolicy>`_  


  **Request Syntax**
  ::

    response = client.get_data_retrieval_policy(
        
    )
    
  :type accountId: string
  :param accountId: 

    The ``AccountId`` value is the AWS account ID. This value must match the AWS account ID associated with the credentials used to sign the request. You can either specify an AWS account ID or optionally a single ' ``-``' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.

        Note: this parameter is set to "-" bydefault if no value is not specified.


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

    
    ::

      {
          'Policy': {
              'Rules': [
                  {
                      'Strategy': 'string',
                      'BytesPerHour': 123
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the Amazon Glacier response to the ``GetDataRetrievalPolicy`` request.

      
      

      - **Policy** *(dict) --* 

        Contains the returned data retrieval policy in JSON format.

        
        

        - **Rules** *(list) --* 

          The policy rule. Although this is a list type, currently there must be only one rule, which contains a Strategy field and optionally a BytesPerHour field.

          
          

          - *(dict) --* 

            Data retrieval policy rule.

            
            

            - **Strategy** *(string) --* 

              The type of data retrieval policy to set.

               

              Valid values: BytesPerHour|FreeTier|None

              
            

            - **BytesPerHour** *(integer) --* 

              The maximum number of bytes that can be retrieved in an hour.

               

              This field is required only if the value of the Strategy field is ``BytesPerHour``. Your PUT operation will be rejected if the Strategy field is not set to ``BytesPerHour`` and you set this field.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`Glacier.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`Glacier.Client.exceptions.MissingParameterValueException`

  
  *   :py:class:`Glacier.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Glacier.Client.exceptions.NoLongerSupportedException`

  

  **Examples**

  The example returns the current data retrieval policy for the account.
  ::

    response = client.get_data_retrieval_policy(
        accountId='-',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Policy': {
            'Rules': [
                {
                    'BytesPerHour': 10737418240,
                    'Strategy': 'BytesPerHour',
                },
            ],
        },
        'ResponseMetadata': {
            '...': '...',
        },
    }

  