Skip to main content

datasets

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

Overview

Namedatasets
TypeResource
Idaws.iotsitewise.datasets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the dataset. (pattern: <code>^(?!00000000-0000-0000-0000-000000000000)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>)
namestringThe name of the dataset. (pattern: <code>^[a-zA-Z0-9 _-#$*!@.]+$</code>)
arnstringThe ARN of the dataset. The format is arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}. (pattern: <code>^arn:aws(-cn|-us-gov)?:[a-zA-Z0-9-:/_.]+$</code>)
creation_datestring (date-time)The dataset creation date, in Unix epoch time.
dataset_typestringThe type of dataset: a session dataset, a curated dataset, or a connection to an external datasource. (SESSION, CURATED, EXTERNAL)
descriptionstringA description about the dataset, and its functionality. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
enrichment_statusobjectThe enrichment status of the dataset.
last_update_datestring (date-time)The date the dataset was last updated, in Unix epoch time.
source_typestringThe data source type of the dataset. (KENDRA, SITEWISE)
statusobjectThe status of the dataset. This contains the state and any error messages. The state is ACTIVE when ready to use.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_datasetsselectsourceType, regionworkspaceName, datasetType, nextToken, maxResultsRetrieves a paginated list of datasets for a specific target resource.
describe_datasetselectdataset_id, regionworkspaceName, datasetVersionRetrieves information about a dataset.
create_datasetinsertregion, datasetName, datasetSourceCreates a dataset. Session and curated datasets are created in a workspace. A session dataset contains data segments of time series data, and a curated dataset curates data segments selected from source session datasets. A dataset that connects to an external datasource is created outside of a workspace.
update_datasetupdatedataset_id, region, datasetName, datasetSourceUpdates a dataset.
delete_datasetdeletedataset_id, regionworkspaceName, clientTokenDeletes a dataset. This can't be undone. Deleting a session dataset also deletes the underlying time series data in the session. You can't delete a session dataset while a curated dataset references its data segments. First delete the curated dataset or disassociate the data segments. Deleting a curated dataset doesn't delete the underlying data in the source session datasets.

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
dataset_idstringThe ID of the dataset.
regionstringAWS region (default: us-east-1)
sourceTypestringThe type of data source for the dataset.
clientTokenstringA 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.
datasetTypestringThe type of dataset to filter by: a session dataset, a curated dataset, or a connection to an external datasource.
datasetVersionstringThe version of the dataset.
maxResultsintegerThe maximum number of results to return for each paginated request.
nextTokenstringThe token for the next set of results, or null if there are no additional results.
workspaceNamestringThe name of the workspace that contains the dataset.

SELECT examples

Retrieves a paginated list of datasets for a specific target resource.

SELECT
id,
name,
arn,
creation_date,
dataset_type,
description,
enrichment_status,
last_update_date,
source_type,
status
FROM aws.iotsitewise.datasets
WHERE sourceType = '{{ sourceType }}' -- required
AND region = '{{ region }}' -- required
AND workspaceName = '{{ workspaceName }}'
AND datasetType = '{{ datasetType }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;

INSERT examples

Creates a dataset. Session and curated datasets are created in a workspace. A session dataset contains data segments of time series data, and a curated dataset curates data segments selected from source session datasets. A dataset that connects to an external datasource is created outside of a workspace.

INSERT INTO aws.iotsitewise.datasets (
datasetId,
datasetName,
datasetDescription,
datasetType,
datasetConfig,
workspaceName,
metadata,
datasetSource,
clientToken,
tags,
region
)
SELECT
'{{ datasetId }}',
'{{ datasetName }}' /* required */,
'{{ datasetDescription }}',
'{{ datasetType }}',
'{{ datasetConfig }}',
'{{ workspaceName }}',
'{{ metadata }}',
'{{ datasetSource }}' /* required */,
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
dataset_arn,
dataset_id,
dataset_status
;

UPDATE examples

Updates a dataset.

UPDATE aws.iotsitewise.datasets
SET
workspaceName = '{{ workspaceName }}',
datasetName = '{{ datasetName }}',
datasetDescription = '{{ datasetDescription }}',
datasetConfig = '{{ datasetConfig }}',
metadata = '{{ metadata }}',
datasetSource = '{{ datasetSource }}',
clientToken = '{{ clientToken }}'
WHERE
dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
AND datasetName = '{{ datasetName }}' --required
AND datasetSource = '{{ datasetSource }}' --required
RETURNING
dataset_arn,
dataset_id,
dataset_status;

DELETE examples

Deletes a dataset. This can't be undone. Deleting a session dataset also deletes the underlying time series data in the session. You can't delete a session dataset while a curated dataset references its data segments. First delete the curated dataset or disassociate the data segments. Deleting a curated dataset doesn't delete the underlying data in the source session datasets.

DELETE FROM aws.iotsitewise.datasets
WHERE dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
AND workspaceName = '{{ workspaceName }}'
AND clientToken = '{{ clientToken }}'
;