Class: AWSCDK::IoTEvents::CfnDetectorModel::IotSiteWiseProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t_events/cfn_detector_model.rb

Overview

Sends information about the detector model instance and the event that triggered the action to a specified asset property in AWS IoT SiteWise .

You must use expressions for all parameters in IotSiteWiseAction . The expressions accept literals, operators, functions, references, and substitutions templates.

Examples - For literal values, the expressions must contain single quotes. For example, the value for the property_alias parameter can be '/company/windfarm/3/turbine/7/temperature' .

  • For references, you must specify either variables or input values. For example, the value for the asset_id parameter can be $input.TurbineInput.assetId1 .
  • For a substitution template, you must use ${} , and the template must be in single quotes. A substitution template can also contain a combination of literals, operators, functions, references, and substitution templates.

In the following example, the value for the property_alias parameter uses a substitution template.

'company/windfarm/${$input.TemperatureInput.sensorData.windfarmID}/turbine/ ${$input.TemperatureInput.sensorData.turbineID}/temperature'

You must specify either property_alias or both asset_id and property_id to identify the target asset property in AWS IoT SiteWise .

For more information, see Expressions in the AWS IoT Events Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property_value:, asset_id: nil, entry_id: nil, property_alias: nil, property_id: nil) ⇒ IotSiteWiseProperty

Returns a new instance of IotSiteWiseProperty.

Parameters:

  • property_value (AWSCDK::IResolvable, AWSCDK::IoTEvents::CfnDetectorModel::AssetPropertyValueProperty)

    The value to send to the asset property.

  • asset_id (String, nil) (defaults to: nil)

    The ID of the asset that has the specified property.

  • entry_id (String, nil) (defaults to: nil)

    A unique identifier for this entry.

  • property_alias (String, nil) (defaults to: nil)

    The alias of the asset property.

  • property_id (String, nil) (defaults to: nil)

    The ID of the asset property.



1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
# File 'io_t_events/cfn_detector_model.rb', line 1469

def initialize(property_value:, asset_id: nil, entry_id: nil, property_alias: nil, property_id: nil)
  @property_value = property_value.is_a?(Hash) ? ::AWSCDK::IoTEvents::CfnDetectorModel::AssetPropertyValueProperty.new(**property_value.transform_keys(&:to_sym)) : property_value
  Jsii::Type.check_type(@property_value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3RldmVudHMuQ2ZuRGV0ZWN0b3JNb2RlbC5Bc3NldFByb3BlcnR5VmFsdWVQcm9wZXJ0eSJ9XX19")), "propertyValue")
  @asset_id = asset_id
  Jsii::Type.check_type(@asset_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetId") unless @asset_id.nil?
  @entry_id = entry_id
  Jsii::Type.check_type(@entry_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "entryId") unless @entry_id.nil?
  @property_alias = property_alias
  Jsii::Type.check_type(@property_alias, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyAlias") unless @property_alias.nil?
  @property_id = property_id
  Jsii::Type.check_type(@property_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyId") unless @property_id.nil?
end

Instance Attribute Details

#asset_idString? (readonly)

The ID of the asset that has the specified property.



1493
1494
1495
# File 'io_t_events/cfn_detector_model.rb', line 1493

def asset_id
  @asset_id
end

#entry_idString? (readonly)

A unique identifier for this entry.

You can use the entry ID to track which data entry causes an error in case of failure. The default is a new unique identifier.



1500
1501
1502
# File 'io_t_events/cfn_detector_model.rb', line 1500

def entry_id
  @entry_id
end

#property_aliasString? (readonly)

The alias of the asset property.



1505
1506
1507
# File 'io_t_events/cfn_detector_model.rb', line 1505

def property_alias
  @property_alias
end

#property_idString? (readonly)

The ID of the asset property.



1510
1511
1512
# File 'io_t_events/cfn_detector_model.rb', line 1510

def property_id
  @property_id
end

#property_valueAWSCDK::IResolvable, AWSCDK::IoTEvents::CfnDetectorModel::AssetPropertyValueProperty (readonly)

The value to send to the asset property.

This value contains timestamp, quality, and value (TQV) information.



1488
1489
1490
# File 'io_t_events/cfn_detector_model.rb', line 1488

def property_value
  @property_value
end

Class Method Details

.jsii_propertiesObject



1512
1513
1514
1515
1516
1517
1518
1519
1520
# File 'io_t_events/cfn_detector_model.rb', line 1512

def self.jsii_properties
  {
    :property_value => "propertyValue",
    :asset_id => "assetId",
    :entry_id => "entryId",
    :property_alias => "propertyAlias",
    :property_id => "propertyId",
  }
end

Instance Method Details

#to_jsiiObject



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'io_t_events/cfn_detector_model.rb', line 1522

def to_jsii
  result = {}
  result.merge!({
    "propertyValue" => @property_value,
    "assetId" => @asset_id,
    "entryId" => @entry_id,
    "propertyAlias" => @property_alias,
    "propertyId" => @property_id,
  })
  result.compact
end