Connector Functions

OpenGate users can use the Connector Functions feature to specify how to process data shared between the OpenGate platform and remote devices.

The following sections show an overview of how to use the API Connector Functions REST API.

Connector Function specification

API users can configure Connector Functions using JSON format.

Each function will have a javascript field with valid JavaScript code following Connector Functions JS API with the Connector Function logic. The REST API performs minimal JavaScript parsing when creating or updating Connector Functions.

Every Connector Function belongs only to a specific channel, and its name must be unique in the channel.

OperationalStatus

This field is mandatory and indicates when the Connector function will run if the connector function criteria match.

  • DISABLED: OpenGate won’t use the Connector Function.
  • PRODUCTION: OpenGate will use the Connector Function.

REQUEST Connector Functions

If one Connector Function is of type REQUEST, operationName will be mandatory, and the specified name must be valid Operation Type for the user using the REST API.

In this case, northCriterias will be mandatory. It is impossible to define more than one Connector Function with the same list of northCriterias.

In this case, southCriterias must be null or not defined.

RESPONSE and COLLECTION Connector Functions

If one Connector Function is of type RESPONSE or COLLECTION southCriterias will be mandatory. southCriterias can contain one or more URIs. Still, each URI only can be defined in one Connector Function. Each URI must start with the correct protocol specification: https://, mqtts://, wss://, snmps://, dlms://. It is possible to configure these valid protocols.

In this case, northCriteria and operationName must be null or not defined.

Permissions

  • CREATE, UPDATE, DELETE: users with admin, admin_domain, super_admin_domain or root profiles.
  • GET and GET List actions can be done by any profile.

Forbidden words

Because already exist several helpers functions and objects available for developing new connector function scripts, there are words which can not be used for avoiding conflicts. These are: cf, collection, response, snmp, utils, dlms