:doc:`IoT <../../iot>` / Client / get_percentiles

***************
get_percentiles
***************



.. py:method:: IoT.Client.get_percentiles(**kwargs)

  

  Groups the aggregated values that match the query into percentile groupings. The default percentile groupings are: 1,5,25,50,75,95,99, although you can specify your own when you call ``GetPercentiles``. This function returns a value for each percentile group specified (or the default percentile groupings). The percentile group "1" contains the aggregated field value that occurs in approximately one percent of the values that match the query. The percentile group "5" contains the aggregated field value that occurs in approximately five percent of the values that match the query, and so on. The result is an approximation, the more values that match the query, the more accurate the percentile values.

   

  Requires permission to access the `GetPercentiles <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPercentiles>`_  


  **Request Syntax**
  ::

    response = client.get_percentiles(
        indexName='string',
        queryString='string',
        aggregationField='string',
        queryVersion='string',
        percents=[
            123.0,
        ]
    )
    
  :type indexName: string
  :param indexName: 

    The name of the index to search.

    

  
  :type queryString: string
  :param queryString: **[REQUIRED]** 

    The search query string.

    

  
  :type aggregationField: string
  :param aggregationField: 

    The field to aggregate.

    

  
  :type queryVersion: string
  :param queryVersion: 

    The query version.

    

  
  :type percents: list
  :param percents: 

    The percentile groups returned.

    

  
    - *(float) --* 

    

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

    
    ::

      {
          'percentiles': [
              {
                  'percent': 123.0,
                  'value': 123.0
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **percentiles** *(list) --* 

        The percentile values of the aggregated fields.

        
        

        - *(dict) --* 

          Describes the percentile and percentile value.

          
          

          - **percent** *(float) --* 

            The percentile.

            
          

          - **value** *(float) --* 

            The value of the percentile.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

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

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidQueryException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidAggregationException`

  
  *   :py:class:`IoT.Client.exceptions.IndexNotReadyException`

  