datasets
Creates, updates, deletes, gets or lists a datasets resource.
Overview
| Name | datasets |
| Type | Resource |
| Id | aws.iotsitewise.datasets |
Fields
The following fields are returned by SELECT queries:
- list_datasets
- describe_dataset
| Name | Datatype | Description |
|---|---|---|
id | string | The 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>) |
name | string | The name of the dataset. (pattern: <code>^[a-zA-Z0-9 _-#$*!@.]+$</code>) |
arn | string | The 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_date | string (date-time) | The dataset creation date, in Unix epoch time. |
dataset_type | string | The type of dataset: a session dataset, a curated dataset, or a connection to an external datasource. (SESSION, CURATED, EXTERNAL) |
description | string | A description about the dataset, and its functionality. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
enrichment_status | object | The enrichment status of the dataset. |
last_update_date | string (date-time) | The date the dataset was last updated, in Unix epoch time. |
source_type | string | The data source type of the dataset. (KENDRA, SITEWISE) |
status | object | The status of the dataset. This contains the state and any error messages. The state is ACTIVE when ready to use. |
| Name | Datatype | Description |
|---|---|---|
dataset_arn | string | The 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>) |
dataset_config | object | Contains the configuration for a dataset. |
dataset_creation_date | string (date-time) | The dataset creation date, in Unix epoch time. |
dataset_description | string | A description about the dataset, and its functionality. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
dataset_id | string | The 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>) |
dataset_last_update_date | string (date-time) | The date the dataset was last updated, in Unix epoch time. |
dataset_name | string | The name of the dataset. (pattern: <code>^[a-zA-Z0-9 _-#$*!@.]+$</code>) |
dataset_source | object | The data source for the dataset. |
dataset_status | object | The status of the dataset. This contains the state and any error messages. State is CREATING after a successfull call to this API, and any associated error message. The state is ACTIVE when ready to use. |
dataset_type | string | The type of dataset: a session dataset, a curated dataset, or a connection to an external datasource. (SESSION, CURATED, EXTERNAL) |
dataset_version | string | The version of the dataset. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
enrichment_status | object | The enrichment status of the dataset. |
metadata | object | The metadata for the dataset. |
workspace_name | string | The name of the workspace that contains the dataset. (pattern: <code>^[a-zA-Z0-9_-]+$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_datasets | select | sourceType, region | workspaceName, datasetType, nextToken, maxResults | Retrieves a paginated list of datasets for a specific target resource. |
describe_dataset | select | dataset_id, region | workspaceName, datasetVersion | Retrieves information about a dataset. |
create_dataset | insert | region, datasetName, datasetSource | 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. | |
update_dataset | update | dataset_id, region, datasetName, datasetSource | Updates a dataset. | |
delete_dataset | delete | dataset_id, region | workspaceName, clientToken | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
dataset_id | string | The ID of the dataset. |
region | string | AWS region (default: us-east-1) |
sourceType | string | The type of data source for the dataset. |
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. |
datasetType | string | The type of dataset to filter by: a session dataset, a curated dataset, or a connection to an external datasource. |
datasetVersion | string | The version of the dataset. |
maxResults | integer | The maximum number of results to return for each paginated request. |
nextToken | string | The token for the next set of results, or null if there are no additional results. |
workspaceName | string | The name of the workspace that contains the dataset. |
SELECT examples
- list_datasets
- describe_dataset
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 }}'
;
Retrieves information about a dataset.
SELECT
dataset_arn,
dataset_config,
dataset_creation_date,
dataset_description,
dataset_id,
dataset_last_update_date,
dataset_name,
dataset_source,
dataset_status,
dataset_type,
dataset_version,
enrichment_status,
metadata,
workspace_name
FROM aws.iotsitewise.datasets
WHERE dataset_id = '{{ dataset_id }}' -- required
AND region = '{{ region }}' -- required
AND workspaceName = '{{ workspaceName }}'
AND datasetVersion = '{{ datasetVersion }}'
;
INSERT examples
- create_dataset
- Manifest
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
;
# Description fields are for documentation purposes
- name: datasets
props:
- name: region
value: "{{ region }}"
description: Required parameter for the datasets resource.
- name: datasetId
value: "{{ datasetId }}"
- name: datasetName
value: "{{ datasetName }}"
- name: datasetDescription
value: "{{ datasetDescription }}"
- name: datasetType
value: "{{ datasetType }}"
valid_values: ['SESSION', 'CURATED', 'EXTERNAL']
- name: datasetConfig
description: |
Contains the configuration for a dataset.
value:
session:
sessionStartTimestamp:
timeInSeconds: {{ timeInSeconds }}
offsetInNanos: {{ offsetInNanos }}
sessionEndTimestamp:
timeInSeconds: {{ timeInSeconds }}
offsetInNanos: {{ offsetInNanos }}
- name: workspaceName
value: "{{ workspaceName }}"
- name: metadata
value: "{{ metadata }}"
- name: datasetSource
description: |
The data source for the dataset.
value:
sourceType: "{{ sourceType }}"
sourceFormat: "{{ sourceFormat }}"
sourceDetail:
kendra:
knowledgeBaseArn: "{{ knowledgeBaseArn }}"
roleArn: "{{ roleArn }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_dataset
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
- delete_dataset
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 }}'
;