:doc:`DeadlineCloud <../../deadline>` / Client / start_sessions_statistics_aggregation

*************************************
start_sessions_statistics_aggregation
*************************************



.. py:method:: DeadlineCloud.Client.start_sessions_statistics_aggregation(**kwargs)

  

  Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the ``GetSessionsStatisticsAggregation`` operation. You can only have one running aggregation for your Deadline Cloud farm. Call the ``GetSessionsStatisticsAggregation`` operation and check the ``status`` field to see if an aggregation is running. Statistics are available for 1 hour after you call the ``StartSessionsStatisticsAggregation`` operation.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/deadline-2023-10-12/StartSessionsStatisticsAggregation>`_  


  **Request Syntax**
  ::

    response = client.start_sessions_statistics_aggregation(
        farmId='string',
        resourceIds={
            'queueIds': [
                'string',
            ],
            'fleetIds': [
                'string',
            ]
        },
        startTime=datetime(2015, 1, 1),
        endTime=datetime(2015, 1, 1),
        timezone='string',
        period='HOURLY'|'DAILY'|'WEEKLY'|'MONTHLY',
        groupBy=[
            'QUEUE_ID'|'FLEET_ID'|'JOB_ID'|'USER_ID'|'USAGE_TYPE'|'INSTANCE_TYPE'|'LICENSE_PRODUCT',
        ],
        statistics=[
            'SUM'|'MIN'|'MAX'|'AVG',
        ]
    )
    
  :type farmId: string
  :param farmId: **[REQUIRED]** 

    The identifier of the farm that contains queues or fleets to return statistics for.

    

  
  :type resourceIds: dict
  :param resourceIds: **[REQUIRED]** 

    A list of fleet IDs or queue IDs to gather statistics for.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``queueIds``, ``fleetIds``. 

  
    - **queueIds** *(list) --* 

      One to 10 queue IDs that specify the queues to return statistics for. If you specify the ``queueIds`` field, you can't specify the ``fleetIds`` field.

      

    
      - *(string) --* 

      
  
    - **fleetIds** *(list) --* 

      One to 10 fleet IDs that specify the fleets to return statistics for. If you specify the ``fleetIds`` field, you can't specify the ``queueIds`` field.

      

    
      - *(string) --* 

      
  
  
  :type startTime: datetime
  :param startTime: **[REQUIRED]** 

    The Linux timestamp of the date and time that the statistics start.

    

  
  :type endTime: datetime
  :param endTime: **[REQUIRED]** 

    The Linux timestamp of the date and time that the statistics end.

    

  
  :type timezone: string
  :param timezone: 

    The timezone to use for the statistics. Use UTC notation such as "UTC+8."

    

  
  :type period: string
  :param period: 

    The period to aggregate the statistics.

    

  
  :type groupBy: list
  :param groupBy: **[REQUIRED]** 

    The field to use to group the statistics.

    

  
    - *(string) --* 

    

  :type statistics: list
  :param statistics: **[REQUIRED]** 

    One to four statistics to return.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'aggregationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **aggregationId** *(string) --* 

        A unique identifier for the aggregated statistics. Use this identifier with the ``GetAggregatedStatisticsForSessions`` operation to return the statistics.

        
  
  **Exceptions**
  
  *   :py:class:`DeadlineCloud.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`DeadlineCloud.Client.exceptions.InternalServerErrorException`

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

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

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

  