IoTSiteWise / Client / create_enrichment_job
create_enrichment_job¶
- IoTSiteWise.Client.create_enrichment_job(**kwargs)¶
Creates an asynchronous enrichment job to analyze time-series sensor data. The operation returns immediately with job details while processing continues in the background.
Idempotency
Include a clientToken to make the operation idempotent. If you submit the same request with the same token within the idempotency window, you receive the original job details without creating a duplicate.
Prerequisites
Before creating a job, ensure:
The workspace is in ACTIVE state (not being deleted)
You have IAM permissions for the workspace, dataset, and time-series resources
You have KMS Decrypt permission on the workspace’s customer-managed encryption key
No duplicate job (same workspace, dataset, property, and job type) is currently running
Workflow
Submit the job with configuration specifying which video data to analyze and the time range
Capture the jobId from the response
Use DescribeEnrichmentJob to monitor progress and check job status
When status reaches a terminal state (COMPLETED, FAILED, TIMED_OUT, CANCELLED), check results
For COMPLETED jobs, query IoT SiteWise for semantic search on video events
Error Handling
ConflictingOperationException: A duplicate job is already running for the same configuration
InvalidRequestException: Invalid parameters (e.g., both timeSeriesId and propertyAlias specified)
AccessDeniedException: Insufficient IAM or KMS permissions
LimitExceededException: Too many concurrent jobs or requests
See also: AWS API Documentation
Request Syntax
response = client.create_enrichment_job( workspaceName='string', jobConfiguration={ 'eventDetection': { 'datasetId': 'string', 'timeSeriesId': 'string', 'propertyAlias': 'string', 'trimSettings': { 'startTime': { 'timeInSeconds': 123, 'offsetInNanos': 123 }, 'endTime': { 'timeInSeconds': 123, 'offsetInNanos': 123 } } } }, clientToken='string' )
- Parameters:
workspaceName (string) –
[REQUIRED]
The name of the IoT SiteWise workspace containing the video data to analyze.
jobConfiguration (dict) –
[REQUIRED]
Configuration defining the type of enrichment analysis to perform and which video data to analyze. Currently supports eventDetection for generating embeddings from video data for semantic search.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
eventDetection.eventDetection (dict) –
Event detection configuration that generates embeddings from video time-series data enabling natural language similarity search on events. The service processes video data and creates embeddings stored in IoT SiteWise for semantic querying.
datasetId (string) – [REQUIRED] <p>The IoT SiteWise dataset ID containing the video time-series data to analyze. Query IoT SiteWise to discover available datasets in your workspace.</p>
timeSeriesId (string) – <p>Unique system identifier for the video time series to analyze. Specify either timeSeriesId or propertyAlias, but not both. Use this when you have the system-generated time series identifier from IoT SiteWise.</p>
propertyAlias (string) – <p>Human-readable alias for the video time series to analyze (e.g., /camera/warehouse/zone-a). Specify either propertyAlias or timeSeriesId, but not both. Use this when you have configured friendly aliases in IoT SiteWise for better readability.</p>
trimSettings (dict) – [REQUIRED] <p>Time range settings defining which portion of the video time-series data to process. Required to ensure predictable processing time and prevent analyzing unbounded datasets. Start and end times must be within the dataset’s time bounds.</p>
startTime (dict) – [REQUIRED] <p>Start time for the video analysis time range in nanoseconds since Unix epoch (TimeInNanos format). Data segments at or after this time are included in the enrichment. Must be within the dataset’s time bounds.</p> <p>Example (JavaScript): Date.parse(‘2024-01-01T00:00:00Z’) * 1000000 Example (Python): int(datetime.timestamp() * 1e9)</p>
timeInSeconds (integer) – [REQUIRED]
The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by
offsetInNanos.offsetInNanos (integer) –
The nanosecond offset from
timeInSeconds.
endTime (dict) – [REQUIRED] <p>End time for the video analysis time range in nanoseconds since Unix epoch (TimeInNanos format). Data segments at or before this time are included in the enrichment. Must be greater than startTime and within the dataset’s time bounds.</p>
timeInSeconds (integer) – [REQUIRED]
The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond data is provided by
offsetInNanos.offsetInNanos (integer) –
The nanosecond offset from
timeInSeconds.
clientToken (string) –
Optional unique token that makes the operation idempotent. If you submit the same request with the same token within the idempotency window, the service returns the original job without creating a duplicate. Use a UUID or timestamp-based token for each unique request.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'jobId': 'string', 'status': 'PENDING'|'RUNNING'|'COMPLETED'|'FAILED'|'TIMED_OUT'|'CANCELLED', 'createdAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
jobId (string) –
Unique identifier for the enrichment job. Use this ID with DescribeEnrichmentJob to monitor progress or with CancelEnrichmentJob to cancel the job.
status (string) –
Initial status of the enrichment job, typically PENDING. The job will transition to RUNNING when processing begins, then to a terminal state (COMPLETED, FAILED, TIMED_OUT, or CANCELLED). Use DescribeEnrichmentJob to track status changes.
createdAt (datetime) –
Timestamp when the enrichment job was created in ISO 8601 format.
Exceptions