IoT Device Access (IoTDA) Trigger
This section describes how to create an IoTDA trigger on the FunctionGraph console.
For details about the IoTDA event source, see Supported Event Sources.
Notes and Constraints
IoTDA triggers are available only in CN North-Beijing4, CN-Hong Kong, and AP-Bangkok. You can check whether the trigger type is supported on the console.
Prerequisites
- You have created a function.
- You have created an IoTDA instance. For details, see Buying an IoTDA Instance.
- You have created a resource space for the IoTDA instance. For details, see Creating a Resource Space.
Creating an IoTDA Trigger
- Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the function to be configured to go to the function details page.
- Choose Configuration > Triggers and click Create Trigger.
- Configure the following parameters.
- Trigger Type: Select IoT Device Access (IoTDA).
- Instance: Select the created IoTDA instance.
- Data Source, Trigger, and Resource Space: For details, see Table 1.
Table 1 Configuration Data Source
Trigger
Resource Space
Device
Device added, Device deleted, Device updated
Select a resource space. Multiple resource spaces can be created and one of them is specified as the default resource space. Each account has only one default resource space, which cannot be deleted.
Device property
Device property reported
Device message
Device message reported
Device message status
Device message status changed
Device status
Device status changed
Product
Product added, Product deleted, and Product updated
Asynchronous command status of the device
Batch task status changed
Run log
Log reported
Batch task
Batch task status changed
- Click OK.
Triggering the Function
- Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the name of the function to be configured. The function details page is displayed.
- On the function details page, select a version.
- On the Code tab page, click Test. The Configure Test Event dialog box is displayed.
- Set the parameters listed in Table 2 and click Create.
Table 2 Test event information Parameter
Description
Configure Test Event
You can choose to create a test event (default) or edit an existing one.
Event Templates
Select Blank Template.
Event Name
The event name can contain 1 to 25 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. For example, iotda-123test.
Event data
{ "resource" : "device", "event" : "create", "event_time" : "20240919T011335Z", "event_time_ms" : "2024-09-19T01:13:35.854Z", "request_id" : "75127474-1a26-4578-8847-3128d6101954", "notify_data" : { "body" : { "app_id" : "3d40caf3ddfc4e83815b54b50f13aad7", "app_name" : "DefaultApp_6439vdv2", "device_id" : "66eb7a0ffa8d9c36870c6892_ttytytytytytyt", "node_id" : "ttytytytytytyt", "gateway_id" : "66eb7a0ffa8d9c36870c6892_ttytytytytytyt", "node_type" : "GATEWAY", "auth_info" : { "auth_type" : "SECRET", "secure_access" : false, "timeout" : 0 }, "product_id" : "66eb7a0ffa8d9c36870c6892", "product_name" : "test", "status" : "INACTIVE", "create_time" : "20240919T011335Z" } } }
- Click Test. The function test result is displayed.
Helpful Links
Manage function triggers through APIs. For details, see Function Trigger APIs.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot