To configure the “Data to Server” feature on the TRB256 device, the following sequence of 8 API calls is currently required, which seems a bit unusual for a relatively straightforward setup:
Create Collection Config (Disabled Initially)
Create the collection with "enabled": "0" to avoid errors when creating it with "enabled": "1".
Call Status API
Retrieve the collection, input, and output IDs needed for subsequent steps.
Update Input Configuration
Use the retrieved input ID to configure the input parameters (e.g., Modbus settings, members list, format).
Call Status API
Verify that the input config is applied correctly.
Update Output Configuration
Use the output ID to configure the output (e.g., Azure plugin and connection section name).
Call Status API
Confirm the output configuration is applied.
Enable the Collection
Update the collection with "enabled": "1" to activate it now that input and output are properly configured.
Final Status API Call
Verify that the collection is active and everything is working as expected.
Could you please confirm if this is the correct and recommended approach? Also, is there any way to reduce the number of API calls needed to complete this setup?
Your steps seem to be just as required. Input and output configuration must be applied and validated independently before activating the data collection. Skipping these validations may result in undefined system behavior.
You may skip the “validating” of whether a call went through successfully, or in other words, whether the setting was really applied, but you can never be too sure.