Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisMQTTPersistenceGet

int ctMemphisMQTTPersistenceGet( pRCESJson request, ppRCESJson result )

Description:

Retrieve MQTT persistence information from the Replication Manager Database.

HTTP URL: <baseURL>/ctMemphisMQTTPersistenceGet/

HTTP Verb: POST

Parameters:

  • request[IN] - Get MQTT Persistence request in JSON format. For example:

{

"dbEngine": 2, // optional, dbEngine identification - used to list

MQTT persistence by dbEngine instance

"persistenceTopic": "topic/name", // optional, if provided, search MQTT persistence

from the MQTT topic

"partial": true, // optional, if provided with "topic", the search

by topic will look for like "<name>%"

"id": 1, // optional, if provided, search MQTT

persistence by its unique ID

"detail": 1, // optional, if not provided, assumes

detail as true

"paging": true, // optional, see Note 1

"limit": 100, // optional, see Note 1

"start": 200 // optional, see Note 1

}

  • result[OUT] - Result in JSON format.

Notes:

Status values can be: "inactive", "active" and "paused"

statusCode values can be: 0 = "inactive", 1 = "active" and 5 = "paused"

tableRetentionUnit values are: "minute", "hour", "day", "month" or "year"

If detail is 1:

{

"mqttPersistenceList": [

{

"id": 1, // Unique MQTT persistence

identification

"persistenceTopic": "topic/name", // MQTT persistence topic name

"status": "active", // see "Status" for values

"statusCode": 1, // see "statusCode" for values

"statusTime": "2015-11-05T10:00:00", // Last time the status changed

"statusMsg": "", // Message related to last status

"persistenceTopicMessageFormat": "JSON", // MQTT payload message type

"persistenceTopicThreads": 10, // Number of threads used for

persistence

"dbEngine": 2, // DBEngine identification where

persistence is executed

"database": 3, // Database identification where

persistence is executed

"tableName": "table_name", // Table name where the topic

is persisted

"tableReplicationReady": TRUE, // Flag indicating if persistence

table is replication ready

"tableAutoTimeStamp": TRUE, // Flag indicating if persistence

table has auto timestamp field

"tableAutoTimeStampIndex": TRUE, // Flag indicating if persistence

table has auto timestamp index

"tableRetentionPeriod": 10, // Number of "tableRetentionUnit"

to be retained

"tableRetentionUnit": "day", // Retention period unit, see

"tableRetentionUnit" for

supported values

"mapOfPropertiesToFields": [

{

"jsonPropertyPath": "prop1", // JSON property name to be mapped

"fieldName": "field1", // Field where the property value is stored

"fieldType": "INTEGER" // See MQTT documentation for MQTT

types supported

},

{

"jsonPropertyPath": "prop2", // JSON property name to be mapped

"fieldName": "field2", // Field where property value

is stored

"fieldType": "DOUBLE", // See MQTT documentation for MQTT

types supported

"fieldWidth": 8, // Field width

"fieldScale": 2 // Field scale

}

]

},

{

"id": 2,

"persistenceTopic": "topic/name2",

"status": "active",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"statusMsg": "",

"persistenceTopicMessageFormat": "JSON",

"persistenceTopicThreads": 5,

"dbEngine": 2,

"database": 3,

"tableName": "table_name2",

"tableReplicationReady": TRUE,

"tableAutoTimeStamp": TRUE,

"tableAutoTimeStampIndex": TRUE,

"tableRetentionPeriod": 10,

"tableRetentionUnit": "day",

"mapOfPropertiesToFields": [

{

"jsonPropertyPath": "prop1",

"fieldName": "field1",

"fieldType": "INTEGER"

},

{

"jsonPropertyPath": "prop2",

"fieldName": "field2",

"fieldType": "DOUBLE",

"fieldWidth": 8,

"fieldScale": 2

}

]

}

]

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"total": 2 // total number of MQTT persistence for query - see Note 1

}

If detail is 0:

{

"mqttPersistenceList": [

{

"id": 1,

"persistenceTopic": "topic/name", // MQTT persistence topic name

"status": "active", // see "Status" for values

"statusCode": 1, // see "statusCode" for values

"statusTime": "2015-11-05T10:00:00", // Last time status changed

"statusMsg": "", // Message related to last status

"dbEngine": 2 // DBEngine identification where

persistence is executed

},

{

"id": 2,

"persistenceTopic": "topic/name2",

"status": "active",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"statusMsg": "",

"dbEngine": 2

}

]

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"total": 2 // total number of MQTT persistence for query - see Note 1

}

Return: Error code

TOCIndex