IoTSiteWise / Client / execute_query

execute_query#

IoTSiteWise.Client.execute_query(**kwargs)#

Run SQL queries to retrieve metadata and time-series data from asset models, assets, measurements, metrics, transforms, and aggregates.

See also: AWS API Documentation

Request Syntax

response = client.execute_query(
    queryStatement='string',
    nextToken='string',
    maxResults=123,
    clientToken='string'
)
Parameters:
  • queryStatement (string) –

    [REQUIRED]

    The IoT SiteWise query statement.

  • nextToken (string) – The string that specifies the next page of results.

  • maxResults (integer) – The maximum number of results to return at one time. The default is 25.

  • clientToken (string) –

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don’t reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'columns': [
        {
            'name': 'string',
            'type': {
                'scalarType': 'BOOLEAN'|'INT'|'DOUBLE'|'TIMESTAMP'|'STRING'
            }
        },
    ],
    'rows': [
        {
            'data': [
                {
                    'scalarValue': 'string',
                    'arrayValue': {'... recursive ...'},
                    'rowValue': {'... recursive ...'},
                    'nullValue': True|False
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • columns (list) –

      Represents a single column in the query results.

      • (dict) –

        A description of the column in the query results.

        • name (string) –

          The name of the column description.

        • type (dict) –

          The type of the column description.

          • scalarType (string) –

            The allowed data types that the column has as it’s value.

    • rows (list) –

      Represents a single row in the query results.

      • (dict) –

        Represents a single row in the query results.

        • data (list) –

          List of data points in a single row of the result set.

          • (dict) –

            Represents a single data point in a query result.

            • scalarValue (string) –

              Indicates if the data point is a scalar value such as integer, string, double, or Boolean.

            • arrayValue (list) –

              Indicates if the data point is an array.

            • rowValue (dict) –

              Indicates if the data point is a row.

            • nullValue (boolean) –

              Indicates if the data point is null.

    • nextToken (string) –

      The string that specifies the next page of results.

Exceptions