Class CfnAssetModel
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggable,IAssetModelRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
You create assets from asset models. With asset models, you can easily create assets of the same type that have standardized definitions. Each asset created from a model inherits the asset model's property and hierarchy definitions. For more information, see Defining asset models in the AWS IoT SiteWise User Guide .
You can create three types of asset models, ASSET_MODEL , COMPONENT_MODEL , or an INTERFACE .
- ASSET_MODEL – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.
- COMPONENT_MODEL – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.
- INTERFACE – An interface is a type of model that defines a standard structure that can be applied to different asset models.
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.*;
CfnAssetModel cfnAssetModel = CfnAssetModel.Builder.create(this, "MyCfnAssetModel")
.assetModelName("assetModelName")
// the properties below are optional
.assetModelCompositeModels(List.of(AssetModelCompositeModelProperty.builder()
.name("name")
.type("type")
// the properties below are optional
.composedAssetModelId("composedAssetModelId")
.compositeModelProperties(List.of(AssetModelPropertyProperty.builder()
.dataType("dataType")
.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()
.hierarchyExternalId("hierarchyExternalId")
.hierarchyId("hierarchyId")
.hierarchyLogicalId("hierarchyLogicalId")
.propertyExternalId("propertyExternalId")
.propertyId("propertyId")
.propertyLogicalId("propertyLogicalId")
.propertyPath(List.of(PropertyPathDefinitionProperty.builder()
.name("name")
.build()))
.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()
.hierarchyExternalId("hierarchyExternalId")
.hierarchyId("hierarchyId")
.hierarchyLogicalId("hierarchyLogicalId")
.propertyExternalId("propertyExternalId")
.propertyId("propertyId")
.propertyLogicalId("propertyLogicalId")
.propertyPath(List.of(PropertyPathDefinitionProperty.builder()
.name("name")
.build()))
.build())
.build()))
.build())
.build())
// the properties below are optional
.dataTypeSpec("dataTypeSpec")
.externalId("externalId")
.id("id")
.logicalId("logicalId")
.unit("unit")
.build()))
.description("description")
.externalId("externalId")
.id("id")
.parentAssetModelCompositeModelExternalId("parentAssetModelCompositeModelExternalId")
.path(List.of("path"))
.build()))
.assetModelDescription("assetModelDescription")
.assetModelExternalId("assetModelExternalId")
.assetModelHierarchies(List.of(AssetModelHierarchyProperty.builder()
.childAssetModelId("childAssetModelId")
.name("name")
// the properties below are optional
.externalId("externalId")
.id("id")
.logicalId("logicalId")
.build()))
.assetModelProperties(List.of(AssetModelPropertyProperty.builder()
.dataType("dataType")
.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()
.hierarchyExternalId("hierarchyExternalId")
.hierarchyId("hierarchyId")
.hierarchyLogicalId("hierarchyLogicalId")
.propertyExternalId("propertyExternalId")
.propertyId("propertyId")
.propertyLogicalId("propertyLogicalId")
.propertyPath(List.of(PropertyPathDefinitionProperty.builder()
.name("name")
.build()))
.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()
.hierarchyExternalId("hierarchyExternalId")
.hierarchyId("hierarchyId")
.hierarchyLogicalId("hierarchyLogicalId")
.propertyExternalId("propertyExternalId")
.propertyId("propertyId")
.propertyLogicalId("propertyLogicalId")
.propertyPath(List.of(PropertyPathDefinitionProperty.builder()
.name("name")
.build()))
.build())
.build()))
.build())
.build())
// the properties below are optional
.dataTypeSpec("dataTypeSpec")
.externalId("externalId")
.id("id")
.logicalId("logicalId")
.unit("unit")
.build()))
.assetModelType("assetModelType")
.enforcedAssetModelInterfaceRelationships(List.of(EnforcedAssetModelInterfaceRelationshipProperty.builder()
.interfaceAssetModelId("interfaceAssetModelId")
.propertyMappings(List.of(EnforcedAssetModelInterfacePropertyMappingProperty.builder()
.interfaceAssetModelPropertyExternalId("interfaceAssetModelPropertyExternalId")
// the properties below are optional
.assetModelPropertyExternalId("assetModelPropertyExternalId")
.assetModelPropertyLogicalId("assetModelPropertyLogicalId")
.build()))
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContains information about a composite model in an asset model.static interfaceDescribes an asset hierarchy that contains a hierarchy's name, ID, and child asset model ID that specifies the type of asset that can be in this hierarchy.static interfaceContains information about an asset model property.static interfaceContains an asset attribute property.static final classA fluent builder forCfnAssetModel.static interfaceContains information about applied interface property and asset model property.static interfaceContains information about applied interface hierarchy and asset model hierarchy.static interfaceContains expression variable information.static interfaceContains an asset metric property.static interfaceContains a time interval window used for data aggregate computations (for example, average, sum, count, and so on).static interfaceRepresents one level between a composite model and the root of the asset model.static interfaceContains a property type, which can be one ofattribute,measurement,metric, ortransform.static interfaceContains an asset transform property.static interfaceContains a tumbling window, which is a repeating fixed-sized, non-overlapping, and contiguous time window.static interfaceIdentifies a property value used in an expression.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.iotsitewise.IAssetModelRef
IAssetModelRef.Jsii$Default, IAssetModelRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAssetModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAssetModel(software.amazon.jsii.JsiiObjectRef objRef) CfnAssetModel(software.constructs.Construct scope, String id, CfnAssetModelProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IAssetModelReffromAssetModelArn(software.constructs.Construct scope, String id, String arn) Creates a new IAssetModelRef from an ARN.static IAssetModelReffromAssetModelId(software.constructs.Construct scope, String id, String assetModelId) Creates a new IAssetModelRef from a assetModelId.The composite models that are part of this asset model.A description for the asset model.The external ID of the asset model.The hierarchy definitions of the asset model.A unique name for the asset model.The property definitions of the asset model.A reference to a AssetModel resource.The type of asset model.The ARN of the asset model, which has the following format.The ID of the asset model.a list of asset model and interface relationships.getTags()Tag Manager which manages the tags for this resource.A list of key-value pairs that contain metadata for the asset.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAssetModelCompositeModels(List<Object> value) The composite models that are part of this asset model.voidThe composite models that are part of this asset model.voidsetAssetModelDescription(String value) A description for the asset model.voidsetAssetModelExternalId(String value) The external ID of the asset model.voidsetAssetModelHierarchies(List<Object> value) The hierarchy definitions of the asset model.voidThe hierarchy definitions of the asset model.voidsetAssetModelName(String value) A unique name for the asset model.voidsetAssetModelProperties(List<Object> value) The property definitions of the asset model.voidThe property definitions of the asset model.voidsetAssetModelType(String value) The type of asset model.voida list of asset model and interface relationships.voida list of asset model and interface relationships.voidsetTagsRaw(List<CfnTag> value) A list of key-value pairs that contain metadata for the asset.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAssetModel
protected CfnAssetModel(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAssetModel
protected CfnAssetModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAssetModel
@Stability(Stable) public CfnAssetModel(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAssetModelProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromAssetModelArn
@Stability(Stable) @NotNull public static IAssetModelRef fromAssetModelArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IAssetModelRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromAssetModelId
@Stability(Stable) @NotNull public static IAssetModelRef fromAssetModelId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String assetModelId) Creates a new IAssetModelRef from a assetModelId.- Parameters:
scope- This parameter is required.id- This parameter is required.assetModelId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAssetModelRef
A reference to a AssetModel resource.- Specified by:
getAssetModelRefin interfaceIAssetModelRef
-
getAttrAssetModelArn
The ARN of the asset model, which has the following format. -
getAttrAssetModelId
The ID of the asset model. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getAssetModelName
A unique name for the asset model. -
setAssetModelName
A unique name for the asset model. -
getAssetModelCompositeModels
The composite models that are part of this asset model.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAssetModel.AssetModelCompositeModelProperty> -
setAssetModelCompositeModels
The composite models that are part of this asset model. -
setAssetModelCompositeModels
The composite models that are part of this asset model. -
getAssetModelDescription
A description for the asset model. -
setAssetModelDescription
A description for the asset model. -
getAssetModelExternalId
The external ID of the asset model. -
setAssetModelExternalId
The external ID of the asset model. -
getAssetModelHierarchies
The hierarchy definitions of the asset model.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAssetModel.AssetModelHierarchyProperty> -
setAssetModelHierarchies
The hierarchy definitions of the asset model. -
setAssetModelHierarchies
The hierarchy definitions of the asset model. -
getAssetModelProperties
The property definitions of the asset model.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAssetModel.AssetModelPropertyProperty> -
setAssetModelProperties
The property definitions of the asset model. -
setAssetModelProperties
The property definitions of the asset model. -
getAssetModelType
The type of asset model. -
setAssetModelType
The type of asset model. -
getEnforcedAssetModelInterfaceRelationships
a list of asset model and interface relationships.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAssetModel.EnforcedAssetModelInterfaceRelationshipProperty> -
setEnforcedAssetModelInterfaceRelationships
@Stability(Stable) public void setEnforcedAssetModelInterfaceRelationships(@Nullable IResolvable value) a list of asset model and interface relationships. -
setEnforcedAssetModelInterfaceRelationships
@Stability(Stable) public void setEnforcedAssetModelInterfaceRelationships(@Nullable List<Object> value) a list of asset model and interface relationships. -
getTagsRaw
A list of key-value pairs that contain metadata for the asset. -
setTagsRaw
A list of key-value pairs that contain metadata for the asset.
-