Analysis Workers#

An analysis worker is responsible for picking up jobs and executing job tasks. The workers then performs different analysis on the submissions, before returning analysis results back. These workers are added to the database with a json schema.

Registering a new analysis worker#

The role ‘ADMINISTRATOR-ROLE’ or higher is required to be able to add an analysis worker.

To register a new analysis worker, the analysis worker endpoint can be used with a POST operation. The request and response body is JSON formatted and contains information about the analysis worker. The example request below adds a new analysis worker.

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker -d '{
	"schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "string"
    },
	"shortName": "worker",
	"localizedNames": {
      "english": "Analysis Worker",
      "norwegian": "Analyse-arbeider",
    }
}'

The schema will not be a part of the response model. For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Updating an analysis worker#

The role ‘ADMINISTRATOR-ROLE’ or higher is required to be able to update an analysis worker.

To update an analysis worker, the analysis worker endpoint can be used with a PUT operation. The request and response body is JSON formatted and contains information about the analysis worker. The example request below updates an analysis worker.

curl -X PUT -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker/<idOrShortName> -d '{
	"schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "string"
    },
	"shortName": "updatedWorker",
	"localizedNames": {
      "english": "Updated Analysis Worker",
      "norwegian": "Oppdatert Analyse-arbeider",
    }
}'

The schema will not be a part of the response model. For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Deleting an analysis worker#

The role ‘ADMINISTRATOR-ROLE’ or higher is required to be able to delete an analysis worker. Before deleting a worker, notify the TI squad.

To delete an analysis worker, the analysis worker endpoint can be used with a DELETE operation. Body is JSON formatted and contains information about the analysis worker. The example request below deletes an analysis worker.

curl -X DELETE -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker/<idOrShortName>

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Fetching analysis workers#

The role ‘SAMPLEDB-VIEWER’ or higher is required to be able to fetch or list analysis workers.

List#

To list analysis workers, the analysis worker endpoint can be used with a GET operation. The response body is JSON formatted and contains information about the analysis workers. The example request below lists non-deleted analysis workers.

curl -X GET -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker?limit=25&offset=0&includeDeleted=false

Fetch a single analysis worker#

To fetch an analysis workers, the analysis worker endpoint can be used with a GET operation. The response body is JSON formatted and contains information about the analysis worker. The example request below fetches an analysis worker.

curl -X GET -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker/<idOrShortName>

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Fetch the JSON schema for the analysis worker#

The role ‘SAMPLEDB-VIEWER’ or higher is required to be able to fetch JSON schemas for analysis workers. The schema is used to validate the analysis result from the analysis worker. If the analysis result does not match the schema, the analysis result is discarded.

To fetch a JSON Schema for an analysis worker, the analysis worker endpoint can be used with a GET operation. The response body is JSON formatted and contains information about the JSON schema. The example request below fetches an JSON schema for an analysis worker.

curl -X GET -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/sampledb/v2/worker/<idOrShortName>/schema