Tentacle Edge Industrial Automation Gateway Graphql API
689

A nodejs industrial automation edge gateway with a GraphQL API.
The best way to get a full featured tentacle install (which includes tentacle-ui and exposes everything on port 80) is using LXD and applying the tentacle-docker profile.
To install tentacle as a global module with all of it's dependencies:
sudo npm install -g --unsafe-perm tentacle-edge
Once installed you can run them command tentacle to start the server. You can use Ctrl-C to stop the server.
The graphql api will then be available at http://localhost:4000. You can also access Graphql Playground, a powerful GraphQL IDE, at that at that address.
The easiest way is to use PM2.
Install PM2
sudo npm install -g pm2
Determine the exact location of the tentacle command
if you have installed tentacle globally, then on linux/OS X the tentacle command will probably be either: /usr/bin/tentacle or /usr/local/bin/tentacle. The command which tentacle can be used to confirm the location.
Tell pm2 to run Tentacle
The following command tells PM2 to run tentacle, assuming /usr/bin/tentacle as the location of the tentacle command.
The -- argument must appear before any arguments you want to pass to tentacle.
pm2 start /usr/bin/tentacle -- -v
This will start tentacle in the background. You can view information about the process and access the log output using the commands:
pm2 info tentacle
pm2 logs tentacle
More information about managing processes under PM2 is available here.
Tell PM2 to run on boot
pm2 save
pm2 startup
This will generate a command that you must copy/paste and run to add the pm2 process to your services.
Reboot
Reboot and verify everything is working as expected.
Read only queries
| Field | Argument | Type | Description |
|---|---|---|---|
| user | User |
Gets user based on authentication header and returns relevant data | |
| tags | [Tag!]! |
Requires a valid authorization token. List of all tags configured in this gateway | |
| scanClasses | [ScanClass!]! |
Requires a valid authorization token. ist of all scan classes configured in this gateway | |
| devices | [Device!]! |
Requires a valid authorization token. List of all devices configured in this gateway | |
| type | String | ||
| services | [Service!]! |
Requires a valid authorization token. List of all services configured in this gateway | |
| type | String |
Read/Write queries
| Field | Argument | Type | Description |
|---|---|---|---|
| login | AuthPayload |
If a valid username and password is provided, this will return an auth payload with a java web token to be used for future requests and information about the user that successfully logged in. | |
| username | String! | ||
| password | String! | ||
| changePassword | User |
Allows the user to change their password | |
| oldPassword | String! | ||
| newPassword | String! | ||
| createScanClass | ScanClass |
Requires a valid authorization token. Creates a new scan class | |
| name | String! | ||
| description | String! | ||
| rate | Int! | ||
| updateScanClass | ScanClass |
Requires a valid authorization token. Updates an existing scan class | |
| id | ID! | ||
| name | String | ||
| description | String | ||
| rate | Int! | ||
| deleteScanClass | ScanClass |
Requires a valid authorization token. Deletes a scan class. Will not be successfully if there are tags currently assigned to this scan class. | |
| id | ID! | ||
| createTag | Tag |
Requires a valid authorization token. Creates a new tag | |
| name | String! | ||
| description | String! | ||
| datatype | Datatype! | ||
| value | String! | ||
| scanClassId | ID! | ||
| min | Float | ||
| max | Float | ||
| deadband | Float | ||
| units | String | ||
| updateTag | Tag |
Requires a valid authorization token. Updates an existing tag | |
| id | ID! | ||
| name | String | ||
| description | String | ||
| datatype | Datatype | ||
| value | String | ||
| scanClassId | ID | ||
| min | Float | ||
| max | Float | ||
| deadband | Float | ||
| units | String | ||
| deleteTag | Tag |
Requires a valid authorization token. Deletes a tag. Will delete any source assigned to this tag, and tag will no longer be scanned. | |
| id | ID! | ||
| createOpcua | Device |
Requires a valid authorization token. Creates a opcua device, and automatically starts a connection. | |
| name | String! | ||
| description | String! | ||
| host | String! | ||
| port | Int! | ||
| retryRate | Int! | ||
| updateOpcua | Device |
Requires a valid authorization token. Updates an existing opcua device and refreshes the connection. | |
| id | ID! | ||
| name | String | ||
| description | String | ||
| host | String | ||
| port | Int | ||
| retryRate | Int | ||
| deleteOpcua | Device |
Requires a valid authorization token. Deletes a opcua device. All sources assigned to this device are deleted and tags using this device as a source will have their sources set to null, making their values static. | |
| id | ID! | ||
| createOpcuaSource | OpcuaSource |
Requires a valid authorization token. Creates a OPC UA source. The tag value will then be updated to the value at the source register per the scan class | |
| deviceId | ID! | ||
| tagId | ID! | ||
| nodeId | String! | ||
| updateOpcuaSource | OpcuaSource |
Requires a valid authorization token. Updates a OPC UA source register. The tag value will then update per the new register at the rate of the scan class. | |
| tagId | ID! | ||
| nodeId | String! | ||
| deleteOpcuaSource | OpcuaSource |
Requires a valid authorization token. Deletes a OPC UA source. The tag value will then be static. | |
| tagId | ID! | ||
| createModbus | Device |
Requires a valid authorization token. Creates an Modbus TCP/IP device, and automatically starts a connection. | |
| name | String! | ||
| description | String! | ||
| host | String! | ||
| port | Int! | ||
| reverseBits | Boolean! | ||
| reverseWords | Boolean! | ||
| zeroBased | Boolean! | ||
| timeout | Int! | ||
| retryRate | Int! | ||
| updateModbus | Device |
Requires a valid authorization token. Updates an existing modbus device and refreshes the connection. | |
| id | ID! | ||
| name | String | ||
| description | String | ||
| host | String | ||
| port | Int | ||
| reverseBits | Boolean | ||
| reverseWords | Boolean | ||
| zeroBased | Boolean | ||
| timeout | Int | ||
| retryRate | Int | ||
| deleteModbus | Device |
Requires a valid authorization token. Deletes a modbus device. All sources assigned to this device are deleted and tags using this device as a source will have their sources set to null, making their values static. | |
| id | ID! | ||
| createModbusSource | ModbusSource |
Requires a valid authorization token. Creates a modbus source. The tag value will then be updated to the value at the source register per the scan class | |
| deviceId | ID! | ||
| tagId | ID! | ||
| register | Int! | ||
| registerType | ModbusRegisterType | ||
| updateModbusSource | ModbusSource |
Requires a valid authorization token. Updates a modbus source register. The tag value will then update per the new register at the rate of the scan class. | |
| tagId | ID! | ||
| register | Int! | ||
| registerType | ModbusRegisterType | ||
| deleteModbusSource | ModbusSource |
Requires a valid authorization token. Deletes a modbus source. The tag value will then be static. | |
| tagId | ID! | ||
| createEthernetIP | Device |
Requires a valid authorization token. Creates an Ethernet/IP device, and automatically starts a connection. | |
| name | String! | ||
| description | String! | ||
| host | String! | ||
| slot | Int! | ||
| updateEthernetIP | Device |
Requires a valid authorization token. Updates an existing Ethernet/IP device and refreshes the connection. | |
| id | ID! | ||
| name | String | ||
| description | String | ||
| host | String | ||
| slot | Int | ||
| deleteEthernetIP | Device |
Requires a valid authorization token. Deletes an Ethernet/IP device. All sources assigned to this device are deleted and tags using this device as a source will have their sources set to null, making their values static. | |
| id | ID! | ||
| createEthernetIPSource | EthernetIPSource |
Requires a valid authorization token. Creates an Ethernet/IP source. The tag value will then be updated to the value at the source register per the scan class | |
| deviceId | ID! | ||
| tagId | ID! | ||
| tagname | String | ||
| updateEthernetIPSource | EthernetIPSource |
Requires a valid authorization token. Updates an Ethernet/IP source tagname. The tag value will then update per the new tagname at the rate of the scan class. | |
| tagId | ID! | ||
| tagname | String | ||
| deleteEthernetIPSource | EthernetIPSource |
Requires a valid authorization token. Deletes an Ethernet/IP source. The tag value will then be static. | |
| tagId | ID! | ||
| createMqtt | Service |
Requires a valid authorization token. Creates an MQTT Sparkplug B service (tied to a single MQTT broker). | |
| name |
Content type
Image
Digest
Size
431.7 MB
Last updated
over 5 years ago
docker pull joyja/tentacle:version-0.0.38