@Stability(value=Stable)
public static interface CfnAssetModel.AssetModelCompositeModelProperty
extends software.amazon.jsii.JsiiSerializable
This object contains the asset property definitions that you define in the composite model. You can use composite asset models to define alarms on this asset model.
If you use the AssetModelCompositeModel property to create an alarm, you must use the following information to define three asset model properties:
AWS/ALARM_TYPE .STRING .Type property, the type name must be Attribute and the default value must be IOT_EVENTS .AWS/ALARM_SOURCE .STRING .Type property, the type name must be Attribute and the default value must be the ARN of the alarm model that you created in AWS IoT Events .
For the ARN of the alarm model, you can use the
Fn::Subintrinsic function to substitute theAWS::Partition,AWS::Region, andAWS::AccountIdvariables in an input string with values that you specify.For example,
Fn::Sub: "arn:${AWS::Partition}:iotevents:${AWS::Region}:${AWS::AccountId}:alarmModel/TestAlarmModel".Replace
TestAlarmModelwith the name of your alarm model.For more information about using the
Fn::Subintrinsic function, see Fn::Sub .
AWS/ALARM_STATE .STRUCT .DataTypeSpec value must be AWS/ALARM_STATE .Type property, the type name must be Measurement .At the bottom of this page, we provide a YAML example that you can modify to create an alarm.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iotsitewise.*;
AssetModelCompositeModelProperty assetModelCompositeModelProperty = AssetModelCompositeModelProperty.builder()
.name("name")
.type("type")
// the properties below are optional
.compositeModelProperties(List.of(AssetModelPropertyProperty.builder()
.dataType("dataType")
.logicalId("logicalId")
.name("name")
.type(PropertyTypeProperty.builder()
.typeName("typeName")
// the properties below are optional
.attribute(AttributeProperty.builder()
.defaultValue("defaultValue")
.build())
.metric(MetricProperty.builder()
.expression("expression")
.variables(List.of(ExpressionVariableProperty.builder()
.name("name")
.value(VariableValueProperty.builder()
.propertyLogicalId("propertyLogicalId")
// the properties below are optional
.hierarchyLogicalId("hierarchyLogicalId")
.build())
.build()))
.window(MetricWindowProperty.builder()
.tumbling(TumblingWindowProperty.builder()
.interval("interval")
// the properties below are optional
.offset("offset")
.build())
.build())
.build())
.transform(TransformProperty.builder()
.expression("expression")
.variables(List.of(ExpressionVariableProperty.builder()
.name("name")
.value(VariableValueProperty.builder()
.propertyLogicalId("propertyLogicalId")
// the properties below are optional
.hierarchyLogicalId("hierarchyLogicalId")
.build())
.build()))
.build())
.build())
// the properties below are optional
.dataTypeSpec("dataTypeSpec")
.unit("unit")
.build()))
.description("description")
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnAssetModel.AssetModelCompositeModelProperty.Builder
A builder for
CfnAssetModel.AssetModelCompositeModelProperty |
static class |
CfnAssetModel.AssetModelCompositeModelProperty.Jsii$Proxy
An implementation for
CfnAssetModel.AssetModelCompositeModelProperty |
| Modifier and Type | Method and Description |
|---|---|
static CfnAssetModel.AssetModelCompositeModelProperty.Builder |
builder() |
default Object |
getCompositeModelProperties()
The asset property definitions for this composite model.
|
default String |
getDescription()
The description of the composite model.
|
String |
getName()
The name of the composite model.
|
String |
getType()
The type of the composite model.
|
@Stability(value=Stable) @NotNull String getName()
@Stability(value=Stable) @NotNull String getType()
For alarm composite models, this type is AWS/ALARM .
@Stability(value=Stable) @Nullable default Object getCompositeModelProperties()
@Stability(value=Stable) @Nullable default String getDescription()
@Stability(value=Stable) static CfnAssetModel.AssetModelCompositeModelProperty.Builder builder()
Copyright © 2022. All rights reserved.