Node-RED M2X Node
=================
A
Node-RED node used to store time-series data in
AT&T M2X. This node is also included out-of-the-box with
AT&T Flow Designer.
AT&T M2X is a cloud-based fully managed time-series data storage service for network connected machine-to-machine (M2M) devices and the Internet of Things (IoT).
Installation
This node is available as an npm package (https://www.npmjs.com/package/node-red-m2x). Run the following command in the root directory of your Node-RED Directory:
npm install node-red-m2x
Usage
Use node-red-m2x to store time-series data from anything in AT&T M2X and manage your M2X devices.
The user will set the following message properties:
- msg.topic - (required)
- msg.sub_topic - (optional)
- msg.payload - (optional)
- msg.action - (required)
- msg.topic_id - (optional)
- msg.sub_topic_id - (optional)
- msg.topic - The type of object to act on - distribution, device, chart, key.
- msg.action - An action to be applied for this type of object - The second level entry in the below list. (catalog for example)
- msg.payload - A json that represents the body for the rest API, only if such is defiend.
- msg.topic_id - A unique id for either device, distribution, key or chart
- msg.sub_topic_id - Defines the unique instance of sub topic such as distributon's device.
<ul>
<li><b>devices</b>
<ul>
<li>catalog
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#List-Search-Public-Devices-Catalog"> Search Catalog </a>
<li> msg.payload - catalog parameters
</ul>
<li>create
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Create-Device"> Create new device </a>
<li> msg.payload - device parameters
</ul>
<li>createTrigger
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Create-Trigger"> Create a new trigger associated with the specified device.</a>
<li> msg.topic_id - The device id
<li> msg.payload
</ul>
<li>deleteDevice
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Delete-Device"> Delete an existing device</a>
<li> msg.topic_id - The device id
</ul>
<li>deleteStream
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Delete-Data-Stream"> Delete a stream</a>
<li> msg.topic_id - The device id
<li> msg.sub_topic_id - The stream name
</ul>
<li>deleteStreamValues
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Delete-Data-Stream-Values"> Delete values from a stream by a date range</a>
<li> msg.topic_id - The device id
<li> msg.sub_topic_id - The stream name
<li> msg.payload - parameters - time range
</ul>
<li>deleteTrigger
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Delete-Trigger"> Delete an existing trigger associated with a specific device.</a>
<li> msg.topic_id - The device id
<li> msg.sub_topic_id - The trigger id
</ul>
<li>groups
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#List-Device-Groups"> List Groups of devices</a>
</ul>
<li>keys
<ul>
<li> Returns a list of API keys associated with the device
<li> msg.topic_id - The device id
</ul>
<li>list
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#List-Search-Devices"> List Devices </a>
<li> msg.payload - The device id
</ul>
<li>location
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Read-Device-Location"> View device current location</a>
<li> msg.topic_id - The device id
</ul>
<li>log
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#View-Request-Log"> Return a list of access log to the supplied device</a>
<li> msg.topic_id - The device id
</ul>
<li>postMultiple
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Post-Device-Updates--Multiple-Values-to-Multiple-Streams-"> Post multiple values to multiple streams</a>
<li> msg.topic_id - The device id
<li> msg.payload - parameters
</ul>
<li>postValues
<ul>
<li><a href="https://m2x.att.com/developer/documentation/v2/device#Post-Data-Stream-Values"> Post timestamped values to an existing stream</a>
<li> msg.topic_id - The device id
<li> msg.sub_topic_id - The stream name
<li> msg.payload - parameters - the values -
<pre>[{ "timestamp": "timeStamp" "value": "value" },
{ "timestamp": "timeStamp","value": "value>"}]
sampleStreamValues
setStreamValue
- Set the stream value
- msg.topic_id - The device id
- msg.sub_topic_id - The stream name
- msg.payload - parameters - the values
stream
- View stream details
- msg.topic_id - The device id
- msg.sub_topic_id - The stream name
- msg.payload
streamStats
- Stream Statistics
- msg.topic_id - The device id
- msg.sub_topic_id - The stream name
- msg.payload
streamValues
streams
testTrigger
trigger
triggers
update
updateLocation
updateStream
- Update a data stream
- msg.topic_id - The device id
- msg.sub_topic_id - The Name of the stream
- msg.payload - parameters
updateStreams
- Update a data stream
- msg.topic_id - The device id
- msg.sub_topic_id - Array of streams names
- msg.payload - parameters
updateTrigger
view