manageService

Configure settings for a FairCom Edge service

  • "manageService" can also send standard actions to the engine to pause, resume, restart, shutdown, and startup the service.
  • A service either collects data and stores it in an integration table or it takes data in an integration table and delivers it to an external system.

 

Request examples

Minimal

{
    "action": "manageService",
    "requestId": "00000012",
    "params": {
        "serviceName": "modbus"
    },
    "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

Typical

{
  "api": "admin",
  "action": "manageService",
  "params": {
    "serviceName": "modbus",
    "authTokens": [
      "authToken1",
      "authToken2"
    ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

Maximal

{
  "api": "admin",
  "requestId": "3",
  "api": "admin",
  "action": "manageService",
  "params": {
    "serviceName": "modbus",
    "authTokens": [
      "authToken1",
      "authToken2"
    ]
  },
  "responseOptions": {
    "binaryFormat": "hex",
    "dataFormat": "objects",
    "numberFormat": "string"
  },
  "apiVersion": "1.0",
  "debug": "max",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

 

 

Response examples

Success

{
    "authToken": "replaceWithAuthTokenFromCreateSession",
    "debugInfo": {
        "request": {
            "authToken": "replaceWithAuthTokenFromCreateSession",
            "api": "admin",
            "action": "manageService",
            "params": {
                "serviceName": "modbus",
                "command": "pause"
            },
            "responseOptions": {},
            "debug": "max"
        }
    },
    "errorCode": 0,
    "errorMessage": ""
}
 
 

Failure

{
  "requestId": "2",
  "result": {
  },
  "errorCode": -1,
  "errorMessage": "authToken invalid or expired.",
  "debugInfo": {
    "request": {
      "requestId": "2",
      "api": "admin",
      "action": "manageService",
      "params": {
        "authTokens": [
          "an AuthToken to be described"
        ]
      },
      "responseOptions": {
        "binaryFormat": "hex",
        "dataFormat": "objects",
        "numberFormat": "string",
        "includeFields": [
        ],
        "excludeFields": [
        ],
        "includePaths": [
        ],
        "excludePaths": [
        ]
      },
      "apiVersion": "1.0",
      "debug": "max",
      "authToken": "replaceWithAuthTokenFromCreateSession"
    },
    "serverSuppliedValues": {
    },
    "errorData": {
    },
    "warnings": [
      {
        "warningCode": 0,
        "warningMessage": "",
        "warningData": {
        }
      }
    ],
    "executionPlan": {
    }
  }
}
 
 

 

Request properties ("params")

Property Description Default Type Limits (inclusive)

serviceName

The "serviceName" property contains the name of a FairCom input or output service. 

See the "params" topic of each specific service for the requirements of this property.

The following services are available as of the V5 release:
  • "MODBUS"
  • "SIEMENSUDT2JSON"
  • "OPCUA"

Note The SQL, JSON RPC, and REST services can automatically query any integration table in FairCom's servers without requiring configuration.

MQTT always represents both input and output services. This is because once a topic is created and assigned to an integration table, any MQTT client can publish messages to it and subscribe to those messages.

Required - No default value string 1 to 64 bytes

authTokens

The "authTokens" property specifies which sessions the server should return in its response. At least one valid "authToken" must be specified in this property.

{
  "api": "admin",
  "requestId": "2",
  "action": "replaceWithCorrectAction",
  "params": {
    "authTokens": [
      "replaceWithAuthTokenFromCreateSession",
      "replaceWithAuthTokenFromCreateSession"
    ]
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
Optional with default of [] array At least one "authToken"