RuleAction
This class encapsulates and extends the ROS resource type ALIYUN::IOT::RuleAction
, which is used to create a rule action for a specified rule.
Initializers
import com.aliyun.ros.cdk.iot.RuleAction;
RuleAction.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.configuration(java.lang.String)
.configuration(IResolvable)
.ruleId(java.lang.Number)
.ruleId(IResolvable)
.type(java.lang.String)
.type(IResolvable)
// .errorActionFlag(java.lang.Boolean)
// .errorActionFlag(IResolvable)
// .iotInstanceId(java.lang.String)
// .iotInstanceId(IResolvable)
.build();
Name | Type | Description |
---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
No description. |
id |
java.lang.String |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
configuration |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property configuration: The configurations of the rule action. |
ruleId |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property ruleId: The ID of the rule for which you want to create an action. |
type |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property type: The type of the rule action. |
errorActionFlag |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property errorActionFlag: Indicates whether the rule action forwarded error operation data. |
iotInstanceId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property iotInstanceId: The ID of the instance. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
configuration
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property configuration: The configurations of the rule action.
You must specify a JSON string. The configurations for different types of rule actions are different. For more information about required syntax and examples, see the following tables.
ruleId
Required
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property ruleId: The ID of the rule for which you want to create an action.
You can use either of the following methods to view the rule ID: 1. Log on to the IoT Platform console and choose Rules>Data Forwarding. 2. Call the ListRule operation.
type
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property type: The type of the rule action.
Valid values: MNS: forwards data in the topics that have been processed by the rule engine to Message Service (MNS) for message transmission. FC: forwards data in the topics that have been processed by the rule engine to Function Compute for event computing. REPUBLISH: forwards data in the topics that have been processed by the rule engine to another IoT Platform topic. AMQP: forwards data to AMQP consumer groups. OTS: forwards data in the topics that have been processed by the rule engine to Table Store for NoSQL data storage. Note Rules of the binary data format (the DataType parameter is set toBINARY) do not support forwarding data to Table Store. Destination Alibaba Cloud services that are supported by the rule engine vary based on regions. For more information about the regions and destination cloud services that are supported by the rule engine, see Regions and zones.
errorActionFlag
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property errorActionFlag: Indicates whether the rule action forwarded error operation data.
Error operation data indicates that the rule engine failed to forward data from the IoT Platform topic to the destination cloud service. A data forwarding failure indicates that forwarding retries also failed. Valid values: true: forwards error operation data. false: forwards normal data instead of error operation data. Default value: false.
iotInstanceId
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property iotInstanceId: The ID of the instance.
This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition |
No description. |
addCount |
No description. |
addDependency |
No description. |
addResourceDesc |
No description. |
applyRemovalPolicy |
No description. |
getAtt |
No description. |
setMetadata |
No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.iot.RuleAction;
RuleAction.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
ref |
java.lang.String |
No description. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this resource is defined. |
resource |
com.aliyun.ros.cdk.core.RosResource |
No description. |
attrActionId |
com.aliyun.ros.cdk.core.IResolvable |
Attribute ActionId: The ID of the rule action. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrActionId
Required
public IResolvable getAttrActionId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ActionId: The ID of the rule action.