:doc:`CloudWatchInternetMonitor <../../internetmonitor>` / Client / get_query_results

*****************
get_query_results
*****************



.. py:method:: CloudWatchInternetMonitor.Client.get_query_results(**kwargs)

  

  Return the data for a query with the Amazon CloudWatch Internet Monitor query interface. Specify the query that you want to return results for by providing a ``QueryId`` and a monitor name.

   

  For more information about using the query interface, including examples, see `Using the Amazon CloudWatch Internet Monitor query interface <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html>`__ in the Amazon CloudWatch Internet Monitor User Guide.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetQueryResults>`_  


  **Request Syntax**
  ::

    response = client.get_query_results(
        MonitorName='string',
        QueryId='string',
        NextToken='string',
        MaxResults=123
    )
    
  :type MonitorName: string
  :param MonitorName: **[REQUIRED]** 

    The name of the monitor to return data for.

    

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

    The ID of the query that you want to return data results for. A ``QueryId`` is an internally-generated identifier for a specific query.

    

  
  :type NextToken: string
  :param NextToken: 

    The token for the next set of results. You receive this token from a previous call.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The number of query results that you want to return with this call.

    

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

    
    ::

      {
          'Fields': [
              {
                  'Name': 'string',
                  'Type': 'string'
              },
          ],
          'Data': [
              [
                  'string',
              ],
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Fields** *(list) --* 

        The fields that the query returns data for. Fields are name-data type pairs, such as ``availability_score``- ``float``.

        
        

        - *(dict) --* 

          Defines a field to query for your application's Amazon CloudWatch Internet Monitor data. You create a data repository by running a query of a specific type. Each ``QueryType`` includes a specific set of fields and datatypes to retrieve data for.

          
          

          - **Name** *(string) --* 

            The name of a field to query your application's Amazon CloudWatch Internet Monitor data for, such as ``availability_score``.

            
          

          - **Type** *(string) --* 

            The data type for a query field, which must correspond to the field you're defining for ``QueryField``. For example, if the query field name is ``availability_score``, the data type is ``float``.

            
      
    
      

      - **Data** *(list) --* 

        The data results that the query returns. Data is returned in arrays, aligned with the ``Fields`` for the query, which creates a repository of Amazon CloudWatch Internet Monitor information for your application. Then, you can filter the information in the repository by using ``FilterParameters`` that you define.

        
        

        - *(list) --* 
          

          - *(string) --* 
      
    
      

      - **NextToken** *(string) --* 

        The token for the next set of results. You receive this token from a previous call.

        
  
  **Exceptions**
  
  *   :py:class:`CloudWatchInternetMonitor.Client.exceptions.InternalServerException`

  
  *   :py:class:`CloudWatchInternetMonitor.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`CloudWatchInternetMonitor.Client.exceptions.LimitExceededException`

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

  