Skip to content

[API] Common Functionality

Kai edited this page Nov 5, 2024 · 3 revisions

Deploying and Instantiating of Process Artifacts

see: Process Artifacts Endpoints

see: Engine: Process Instance Rest Endpoint

Requesting config, profiles, logging and machine information

Artefact Valid On REST Method REST URL Body/Return Value Notes
Status of the Engine Engine GET /status { "running": true,
"version": "0.0.1"
}
shows if the engine is running, is already initialized and which version it has
All Configurable Keys of the Engine MS, Engine GET

PUT

DELETE
/configuration { "key": value, ... } Gets, sets and deletes an engine's configurable keys. GET: the values are already combined from the cli, config.json and default values. PUT: sets and overrides the values in config.json
Gets a specific config keys of the Engine Engine GET /configuration/{key} { "key": value, ... } Gets a specific config key.
All Logs Engine GET
DELETE
/logging[?entries={100}] GET gets all process and standard logs. Optionally it is possible to set the amount of returned entries,
Default: the last 100 entries
DELETE removes all stored standard and process log entries.
Logging Meta-Data Engine GET /logging/status GET gets all the meta data about the logging system: how many tables, how many entries, which processes have logs, next log rotation
All standard Logs Engine GET
DELETE
/logging/standard[?entries={100}] GET gets all standard logs. Optionally it is possible to set the amount of returned entries,
Default: the last 100 entries
DELETE removes all stored standard log entries.
All process Logs Engine GET
DELETE
/logging/process[?entries={100}] GET gets all process logs. Optionally it is possible to set the amount of returned entries,
Default: the last 100 entries
DELETE removes all stored standard log entries.
All process Logs of a process Engine GET
DELETE
/logging/process/{file-name}[?entries={100}] GET gets all process logs of a specific process. Optionally it is possible to set the amount of returned entries,
Default: the last 100 entries
DELETE removes all stored standard log entries.
All process Logs of a process instance Engine GET
DELETE
/logging/process/{file-name}
/instance/{id}[?entries={100}]
GET gets all process logs of a specific process instance. Optionally, it is possible to set the amount of returned entries,
Default: the last 100 entries
DELETE removes all stored standard log entries.
Machine Properties Engine GET /machine {...} returns all machine properties. For a list of all available properties, see here
Machine Properties Engine GET /machine/{property},{property} {...} Returns the specified machine properties. For a list of all available properties, see here
Machines known to the MS MS GET /machines [...] returns all stored or discovered Machines and their last machine properties
Machine Properties MS POST /machines {...} allows adding a new machine with some meta information
Machine Properties MS GET /machines/{machineId} { meta-data...,
"machine": {
machineInfo...
}, "deployedProcesses": {
deploymentInfo...
}
}
returns the known information about a machine, machine contains the information that one would get via the engine machine endpoint without fast changing information like cpu/mem/disk load (this information is only available through websocket api
None MS DELETE /machines/{machineId} deletes the machine from the store if it is currently stored (doesn't affect machines that are only discovered

Engine: Requesting Hard Constraint Evaluation

Artefact REST Method REST URL Request Body Return Body Notes
Trigger local Hard Constraint evaluation POST /evaluation Constraints, see below 200 OK
Negative: 501 Not Implemented
maybe Soft Constraint values, if requested
If softConstraints object is given in the body and not empty, the Engine can decide (profile keys machine.env.allowSCValuesForHomeEnv and machine.env.allowSCValuesForExternalEnv) if it returns the internal values

Request Body:

{
  "requestingMachine": { id, name, hostname, homeEnvId, homeEnvName },
  "processInfo": { id, name, creatorEnvId, creatorEnvName, nextFlowNode },
  "hardConstraints": {
     "user.name": {
       "condition": "===",
       "value": [ "Max", "Jens" ]
     },
     "machine.mem.load": {
       "condition": ">=",
       "value": "10"
     } 
  },
  "softConstraints": [ 
     "machine.cpu.speed",
     "machine.cpu.currentLoad",
     ...
  ]
}

Response Body (if positive):

{
  "machine.cpu.speed": ,
  "machine.cpu.currentLoad": ,}

Engine: Requesting capability information

Artefact REST Method REST URL Body/Return Value Notes
Return a compacted JSON-LD list with all capabilities on the machine GET /capabilities { ...JSON-LD...}
Run Capability and Return Result POST /capabilities/execute { "CapabilityName": <Name>,
"Parameter": {
"para1": 42,
"para2": {
"value": 42,
"unit": "px" },
...},
"Webhook": <URL>
}
This is for testing purposes and does not conform with the Capability concept of the dBPMS. The Webhook is optional. If given one (or multiple) response will be sent via HTTP POST to the given URL (JSON encoded)

Future Endpoints not yet Implemented

Artefact REST Method REST URL Body/Return Value Notes
All Combined Configurable Keys of the Engine (Profiles and Config Keys) GET /configuration { "key": value, ... } Gets an engine configurable keys. Represents all combined key-values of the configuration and the currently active profiles: Home Env > Current Envs > Current User Profile > Default Profile.
All Config Keys GET

PUT

DELTE
/configuration/engine { "key": value, ... } Gets, sets or deletes an engine configuration.
GET: Represents all key-values configuration pair: if there is nothing manually configured (config.json), it returns the default values from config_default.json.
PUT: all manually values, even if they are the default values, will be stored in config.json. values, that are not mentioned will be reseted to their default value (will be deleted from config.json)
DELETE: resets everything to the default values (== empty config.json)
Config Key GET

PUT

DELTE
/configuration/engine/{config-key} { "key": value } reads or writes a specific config-key
All User Profiles GET /configuration/user-profiles { ... } Read the profiles of all stored user profiles
User Profile GET /configuration/user-profiles/{user-id} { ... } Read the profile of one specific stored user profile
Active User GET /configuration/user-profiles/active { ... } Read the user profile of the currently logged in user
All Environment Profiles GET /configuration/environment-profiles { ... } Read the profiles and sub-profiles of all environments stored on the engine
Home Environment Profiles GET /configuration/ environment-profiles/home { ... } Read the base, external and class profiles of the home environment
Home Base Environment Profile GET

PUT

DELETE
/configuration/ environment-profiles/home/base { ... } (see here) Reads, sets and deletes the base profile of the home environment. It is the default profile of the home environment.
Home External Environment Profile GET

PUT

DELETE
/configuration/ environment-profiles/home/external { ... } (see here) Reads, sets and deletes the external profile of the home environment. The external profile is sent to Machines not belonging to the same home environment to be stored as an external environment profile.
Home Class Environment Profile GET

PUT

DELETE
/configuration/ environment-profiles/home/{class-name} { ... } (see here) Reads, sets and deletes a class profile, e.g. a special profile only for Drones. It Extends the restrictions of the base profile for specific classes.
External Environment Profile GET

PUT

DELETE
/configuration/ environment-profiles/{environment-id} { ... } (see here) Reads, sets and deletes the (base) profile of the external environment. There is no differentiation between base, external and class profiles for External Profile on an Engine.

This is the Dev Wiki

Clone this wiki locally