Class: AWSCDK::IoTEvents::CfnAlarmModel::IotSiteWiseProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t_events/cfn_alarm_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(asset_id: nil, entry_id: nil, property_alias: nil, property_id: nil, property_value: nil) ⇒ IotSiteWiseProperty

Returns a new instance of IotSiteWiseProperty.

Parameters:

  • 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.

  • property_value (AWSCDK::IResolvable, AWSCDK::IoTEvents::CfnAlarmModel::AssetPropertyValueProperty, nil) (defaults to: nil)

    The value to send to the asset property.



1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
# File 'io_t_events/cfn_alarm_model.rb', line 1558

def initialize(asset_id: nil, entry_id: nil, property_alias: nil, property_id: nil, property_value: nil)
  @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?
  @property_value = property_value.is_a?(Hash) ? ::AWSCDK::IoTEvents::CfnAlarmModel::AssetPropertyValueProperty.new(**property_value.transform_keys(&:to_sym)) : property_value
  Jsii::Type.check_type(@property_value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3RldmVudHMuQ2ZuQWxhcm1Nb2RlbC5Bc3NldFByb3BlcnR5VmFsdWVQcm9wZXJ0eSJ9XX19")), "propertyValue") unless @property_value.nil?
end

Instance Attribute Details

#asset_idString? (readonly)

The ID of the asset that has the specified property.



1575
1576
1577
# File 'io_t_events/cfn_alarm_model.rb', line 1575

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.



1582
1583
1584
# File 'io_t_events/cfn_alarm_model.rb', line 1582

def entry_id
  @entry_id
end

#property_aliasString? (readonly)

The alias of the asset property.



1587
1588
1589
# File 'io_t_events/cfn_alarm_model.rb', line 1587

def property_alias
  @property_alias
end

#property_idString? (readonly)

The ID of the asset property.



1592
1593
1594
# File 'io_t_events/cfn_alarm_model.rb', line 1592

def property_id
  @property_id
end

#property_valueAWSCDK::IResolvable, ... (readonly)

The value to send to the asset property.

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



1599
1600
1601
# File 'io_t_events/cfn_alarm_model.rb', line 1599

def property_value
  @property_value
end

Class Method Details

.jsii_propertiesObject



1601
1602
1603
1604
1605
1606
1607
1608
1609
# File 'io_t_events/cfn_alarm_model.rb', line 1601

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

Instance Method Details

#to_jsiiObject



1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
# File 'io_t_events/cfn_alarm_model.rb', line 1611

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