Skip to main content

queries

Creates, updates, deletes, gets or lists a queries resource.

Overview

Namequeries
TypeResource
Idaws.iotsitewise.queries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
completed_atstring (date-time)The date and time when the query reached a terminal state, in Unix epoch time. This field is present when the query status is COMPLETED, FAILED, or CANCELED.
error_messagestringA human-readable error description. This field is present when the query status is FAILED.
query_idstringThe unique identifier for a query execution. (pattern: <code>[a-zA-Z0-9-]+</code>)
statisticsobjectThe query execution statistics. This field is present when the query status is COMPLETED.
statusstringThe current query status. (SUBMITTED, RUNNING, COMPLETED, FAILED, CANCELED, CANCELING)
submitted_atstring (date-time)The date and time when the query was submitted, in Unix epoch time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_queryselectworkspace_name, query_id, regionRetrieves information about a query, including its status.
list_queriesselectworkspace_name, regionfilter, maxResults, nextTokenRetrieves a paginated list of queries for a workspace.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
query_idstringThe unique identifier for the query execution.
regionstringAWS region (default: us-east-1)
workspace_namestringThe name of the workspace to list queries for.
filterstringAn optional filter to return only queries with the specified status. The value must be one of the supported query statuses: SUBMITTED, RUNNING, COMPLETED, FAILED, CANCELED, or CANCELING.
maxResultsintegerThe maximum number of results to return for each paginated request.
nextTokenstringThe token to be used for the next set of paginated results.

SELECT examples

Retrieves information about a query, including its status.

SELECT
completed_at,
error_message,
query_id,
statistics,
status,
submitted_at
FROM aws.iotsitewise.queries
WHERE workspace_name = '{{ workspace_name }}' -- required
AND query_id = '{{ query_id }}' -- required
AND region = '{{ region }}' -- required
;