SoloDB Documentation version 0.1-DEV Help

How to track external activity

Last update: 28 January 2024

This HOWTO describes the steps which are necessary to track external activity. External activity is activity which is not tracked by SoloDB itself. For example, if you want to know that an equipment is currently in use, you can run a monitoring program on the host PC which can send an inactivity signal to SoloDB. SoloDB will then store inactivity signal and can send an alert if the equipment is not in use for a certain time.

Prerequisites

  • PC or other device capable of running a program which can send a signal to SoloDB

Steps

The external activity can be sent to SoloDB by sending a HTTP request to the SoloDB API. The request must be a POST request with the following structure

POST https://api.solodb.net/api/create/equipment/module/external-activity Accept: application/json Content-Type: application/json Authorization: Bearer <token> { "module": 2351, "account": "info@solodb.net", "type": "TYPE_GUI", "activity": "Measurement ongoing", "comment": "Now with comment" }

In order to correctly send the request, the module ID and type are required. The required values can be hard-coded into the monitoring programme but can also be retrieved from SoloDB. Read below how to obtain the values for module ID and type.

Obtain the module ID

The module ID can be retrieved by sending a GET request to the Equipment Module list API with a filter on one of the unique properties, for example a hostname or any other the MES Name

For example, if a property pchostname is set with value PC39384 you can use the following request to retrieve the list of modules with this hostname. Note that the list of properties can be found on the Equipment Module page

GET https://api.solodb.net/api/list/equipment/module?property[pchostname]=PC39384 Accept: application/json Content-Type: application/json Authorization: Bearer <token>

If 1 or more modules are found, the module ID can be retrieved from the response. The module ID is the value of the id property. This ID can be used in the POST request to send the external activity to SoloDB.

{ "_links": { "self": { "href": "https:\/\/api.solodb.net\/api\/list\/equipment\/module?page=1" }, "first": { "href": "https:\/\/api.solodb.net\/api\/list\/equipment\/module" }, "last": { "href": "https:\/\/api.solodb.net\/api\/list\/equipment\/module?page=1" } }, "_embedded": { "items": [ { "id": 2232, "name": "PC39384", "mes_name": "PC39384", "active": true, "equipment": { "id": 1232, "name": "EQ1923822", "mes_name": "EQ1923822", "active": true, "active_in_mes": true, "reservation_possible": false, "main_tool_module_id": 2687, "room": { "id": 12, "name": "ROOM1.12", "code": "1.12", "phone": "", "description": "", "building": { "id": 1, "name": "BUILDING 1", "code": "1", "site": { "id": 1, "name": "Fab France", "code": "Fab France", "has_floor_plans": false, "floor_plans": [], "amount": { "buildings": 5 } }, "amount": { "rooms": 46 } }, "amount": { "zone_groups": 0 } } }, "type": { "id": 3, "type": "Process module" }, "properties": [ { "id": 190, "property": "pchostname", "label": "Hostname", "value": "PC39384" }, { "id": 191, "property": "tcpip", "label": "TCP\/IP address", "value": "10.0.2.18" }, { "id": 192, "property": "Unixversion", "label": "Unix version", "value": "64bit" } ], "_links": { "self": { "href": "https:\/\/api.solodb.net\/api\/list\/equipment\/module" } } } ] }, "page_count": 1, "page_size": 25, "total_items": 1, "page": 1 }

Obtain the external activity type

On order to find the correct external activity type, you can send a GET request to the api/list/equipment/module/external-activity/type. This will return a list of all the external activity types which are available in SoloDB. The value of type can be used in the POST request to send the external activity to SoloDB.

The list of activity types can be maintained via Admin > Equipment > External activity types

GET https://api.solodb.net/api/list/equipment/module/external-activity/type Accept: application/json Content-Type: application/json Authorization: Bearer <token>

This will give the following example response

{ "_links": { "self": { "href": "https://staging.imec.solodb.net/api/list/equipment/module/external-activity/type?page=1" }, "first": { "href": "https://staging.imec.solodb.net/api/list/equipment/module/external-activity/type" }, "last": { "href": "https://staging.imec.solodb.net/api/list/equipment/module/external-activity/type?page=1" } }, "_embedded": { "items": [ { "id": 2, "type": "INACTIVE", "description": "Inactivity logged", "is_active": false, "_links": { "self": { "href": "https://staging.imec.solodb.net/api/list/equipment/module/external-activity/type" } } }, { "id": 1, "type": "MEASUREMENT_STARTED", "description": "Measurement started", "is_active": true, "_links": { "self": { "href": "https://staging.imec.solodb.net/api/list/equipment/module/external-activity/type" } } } ] }, "page_count": 1, "page_size": 25, "total_items": 2, "page": 1 }

The active/inactive flag is set in the list of activity types, if the flag is set to inactive each activity with this type will be treated as an "Inactivity" activity.

Check the Swagger documentation for more information about the API.

05 April 2025