SendMessage
|
Sends data to a device.
details
Arguments
Name
|
Description
|
Default |
id R
|
Id of the device to send a message to
|
|
data R
|
The message to send to the device
|
|
messageId
|
The unique message id (defaults to a Guid if not provided)
|
|
ack
|
The acknowledgement of the device (full, success, failure, none)
|
none |
SQL Call
INSERT INTO AzureIoTHub.Message (id, data) VALUES ('dev', 'TEST') WHERE Id = 'dev' exec AzureIoTHub.SendMessage 'dev', 'TEST'
Http Call
/bsc/azureiothub/sendmessage
Output Columns
String id | Id of the device to send a message to | String data | The message to send to the device | String messageId | The unique message id (defaults to a Guid if not provided) | String ack | The acknowledgement of the device (full, success, failure, none) |
|
CreateDevice
|
Creates a new device in an Azure IoT Hub.
details
Arguments
Name
|
Description
|
Default |
id
|
Id of the device. If none is provided, a random name will be assigned.
|
|
primaryKey
|
The primary for the device. If none is provided (or it is null), a random key will be assigned.
|
|
secondaryKey
|
The secondary for the device. If none is provided (or it is null), a random key will be assigned.
|
|
SQL Call
INSERT INTO AzureIoTHub.Devices (id) VALUES ('dev') exec AzureIoTHub.CreateDevice exec AzureIoTHub.CreateDevice 'dev' exec AzureIoTHub.CreateDevice 'dev', 'yhdCIyP8JntgQMYdn3nxQk2EV9bsQLYMVF3EF1pE/Qg=', 'FPIkHoDsX9oo7CWc7Q6zsO6y9fYd3COLRJVnSA3+qgY='
Http Call
/bsc/azureiothub/createdevice
Output Columns
String id | The device name | String primaryKey | The Primary Key of the device | String secondaryKey | The Secondary Key of the device | String connectionString | The connection string for this device | String connectionState | The connection state of this device | DateTime lastActivityTime | The last datetime the device was active | DateTime lastConnectionTime | The last datetime the device connected | DateTime lastStateUpdateTime | The last datetime the device updated its state | Int32 messageCount | The count of messages the device received from the azure IoT Hub | String state | The state of the device | String suspensionReason | The suspension reason for the device |
|
CreateDevices
|
Creates multiple devices in an Azure IoT Hub using a simple replacable format.
details
Arguments
Name
|
Description
|
Default |
range R
|
A numeric range separated by a dash. Ex: 0-9 or 50-99
|
|
id R
|
The name of the device to create with a ? for numeric replacement. Ex: device? or us-?-sensor
|
|
SQL Call
exec AzureIoTHub.CreateDevices '50-99', 'testdevice?'
Http Call
/bsc/azureiothub/createdevices
Output Columns
String id | The device name | String primaryKey | The Primary Key of the device | String secondaryKey | The Secondary Key of the device | String connectionString | The connection string for this device | String connectionState | The connection state of this device | DateTime lastActivityTime | The last datetime the device was active | DateTime lastConnectionTime | The last datetime the device connected | DateTime lastStateUpdateTime | The last datetime the device updated its state | Int32 messageCount | The count of messages the device received from the azure IoT Hub | String state | The state of the device | String suspensionReason | The suspension reason for the device |
|
DeleteDevice
|
Deletes a device in an Azure IoT Hub.
details
Arguments
Name
|
Description
|
Default |
id R
|
Id of the device.
|
|
SQL Call
DELETE FROM AzureIoTHub.Devices WHERE Id = 'dev' exec AzureIoTHub.DeleteDevice 'dev'
Http Call
/bsc/azureiothub/deletedevice
Output Columns
This call does not return data.
|
DeleteDevices
|
Deletes devices in an Azure IoT Hub.
details
Arguments
Name
|
Description
|
Default |
range R
|
A numeric range separated by a dash. Ex: 0-9 or 50-99
|
|
id R
|
The name of the device to create with a ? for numeric replacement. Ex: device? or us-?-sensor
|
|
SQL Call
exec AzureIoTHub.DeleteDevice '0-10', 'dev?iot'
Http Call
/bsc/azureiothub/deletedevices
Output Columns
This call does not return data.
|
FlushDeviceCache
|
Flushes the cached Device collection and underlying connection strings that improves connectivity performance.
details
Arguments
SQL Call
EXEC AzureIoTHub.FlushDeviceCache
Http Call
/bsc/azureiothub/flushdevicecache
Output Columns
This call does not return data.
|
GetDeviceMessages
|
Returns pending device messages.
details
Arguments
Name
|
Description
|
Default |
deviceId
|
Id of the device
|
|
decode
|
True if the message should be decoded using UTF8
|
0 |
peekOnly
|
True if the list of messages should remain in the queue
|
0 |
SQL Call
exec AzureIoTHub.GetDeviceMessages 'dev'
Http Call
/bsc/azureiothub/getdevicemessages
Output Columns
String id | The device name | String correlationId | The correlationId of the message | Int32 deliveryCount | Delivery count for the message | DateTime enqueuedTimeUtc | The UTC time the message was enqueued | DateTime expiryTimeUtc | The UTC time the message will expire | String lockToken | The lock token if any | String messageId | The message unique identifier | Int64 sequenceNumber | The sequence number of the message | String to | The message TO attribute | String userId | The user id sending the message | Object data | Byte array of the payload | String data_utf8 | String of the payload (if requested with decode=1) |
|
ListDevices
|
Returns a list of devices that have been registered in an Azure IoT Hub.
details
Arguments
Name
|
Description
|
Default |
id
|
Id of the device starts with the string provided
|
|
count
|
Count of devices requested
|
|
SQL Call
exec AzureIoTHub.ListDevices 'dev'
Http Call
/bsc/azureiothub/listdevices
Output Columns
String id | The device name | String primaryKey | The Primary Key of the device | String secondaryKey | The Secondary Key of the device | String connectionString | The connection string for this device | String connectionState | The connection state of this device | DateTime lastActivityTime | The last datetime the device was active | DateTime lastConnectionTime | The last datetime the device connected | DateTime lastStateUpdateTime | The last datetime the device updated its state | Int32 messageCount | The count of messages the device received from the azure IoT Hub | String state | The state of the device | String suspensionReason | The suspension reason for the device | String count | Count of devices requested |
|
SendData
|
Sends data from a device.
details
Arguments
Name
|
Description
|
Default |
id R
|
Id of the device to send data from
|
|
data R
|
The data to send to the Azure IoT Hub
|
|
messageId
|
Optional message identifier
|
|
properties
|
List of key value pairs of properties for this message (ex: place=home,priority=high)
|
|
correlationId
|
Optional correlation identifier
|
|
to
|
Optional 'to' property of the message
|
|
userId
|
Optional user identifier of the message
|
|
SQL Call
INSERT INTO AzureIoTHub.Data (id, data) VALUES ('dev', '{"server":"devlap03\Enzo","metric":"loginCount","value":7,"datetime":"2016-4-14 16:35:00"}') WHERE Id = 'dev' exec AzureIoTHub.SendData 'dev', '{"server":"devlap03\Enzo","metric":"loginCount","value":7,"datetime":"2016-4-14 16:35:00"}'
Http Call
/bsc/azureiothub/senddata
Output Columns
String dateTime | Server time when the message was sent | String id | The device id that sent the message | String messageId | The message unique identifier | String data | The message sent | String properties | Properties sent along with the message | String durationms | Send time in milliseconds |
|
SendTestData
|
Sends data from a set of devices.
details
Arguments
Name
|
Description
|
Default |
msgCount R
|
Minimum number of messages to send from devices
|
|
delayms R
|
Delay in millisecond between data send operations
|
|
id R
|
Comma-separated list of the device ids, or device groups, to send data from
|
|
data R
|
The template data to send to the Azure IoT Hub (support functions: #deviceid(), #utcnow(), #utc(), #rndguid(), #rndint(min,max) )
|
|
properties
|
List of key value pairs of properties for this message (ex: place=home,priority=high)
|
|
to
|
Optional 'to' property of the message
|
|
userId
|
Optional user identifier of the message
|
|
SQL Call
exec AzureIoTHub.SendTestData 100, 1000, 'device1,device2', '{"server":"devlap03\Enzo","metric":"loginCount","value":7,"datetime":"2016-4-14 16:35:00"}' exec AzureIoTHub.SendTestData 100, 1000, '[group1],device55,[group2]', '{"server":"devlap03\Enzo","metric":"loginCount","value":7,"datetime":"2016-4-14 16:35:00"}'
Http Call
/bsc/azureiothub/sendtestdata
Output Columns
String dateTime | Server time when the message was sent | String id | The device id that sent the message | String messageId | The message unique identifier | String data | The message sent | String properties | Properties sent along with the message | String durationms | Send time in milliseconds |
|
UpdateDevice
|
Updates a device in an Azure IoT Hub.
details
Arguments
Name
|
Description
|
Default |
id R
|
Id of the device.
|
|
primaryKey
|
The primary for the device. If none is provided (or it is null), a random key will be assigned.
|
|
secondaryKey
|
The secondary for the device. If none is provided (or it is null), a random key will be assigned.
|
|
SQL Call
UPDATE AzureIoTHub.Devices SET primaryKey = null WHERE Id = 'dev' exec AzureIoTHub.UpdateDevice 'dev' exec AzureIoTHub.UpdateDevice 'dev', 'yhdCIyP8JntgQMYdn3nxQk2EV9bsQLYMVF3EF1pE/Qg=', 'FPIkHoDsX9oo7CWc7Q6zsO6y9fYd3COLRJVnSA3+qgY='
Http Call
/bsc/azureiothub/updatedevice
Output Columns
String id | The device name | String primaryKey | The Primary Key of the device | String secondaryKey | The Secondary Key of the device | String connectionString | The connection string for this device | String connectionState | The connection state of this device | DateTime lastActivityTime | The last datetime the device was active | DateTime lastConnectionTime | The last datetime the device connected | DateTime lastStateUpdateTime | The last datetime the device updated its state | Int32 messageCount | The count of messages the device received from the azure IoT Hub | String state | The state of the device | String suspensionReason | The suspension reason for the device |
|