Unicat API Reference

Up - API Reference - Home


data modules

A module is an external application that connects to Unicat using the API. It can store settings for the module, configurations for its various commands, and log commands that have been run.

They have a unique name which is used for storage and retrieval. They also have a version number like 1.0.11 - the highest logged version number is stored.

module data

{
    ,
    "data": {
        "modules": {
            "Update Catalog": {
                "name": "Update Catalog",
                "version": "1.0.11",
                "keys": {
                    "it.should.be.useful.to": "the entire module"
                },
                "actions": {
                    "Catshop update catalog": {
                        "name": "Catshop update catalog",
                        "configuration": {
                            "apikeyname": "Catshop API key",
                            "query": "Ice cream conservators",
                            
                        }
                    }
                },
                "logs": [
                    {
                        "timestamp": 1610635126.04762,
                        "version": "1.0.10",  # an earlier version
                        "action": "Catshop Update Catalog",
                        "configuration": {
                            "apikeyname": "Catshop API key",
                            "query": "Ice cream conservators",
                            
                        },
                        "command": "generate",
                        "started_at": 1610634813.62983,
                        "ended_at": 1610635126.04762,
                        "duration": 312.41779,  # seconds
                        "status": "ok",
                        "output": "plain text output",
                    }
                ]
            }

        }
    }
}

Module properties

name unique module name
version highest logged version number for the module, in 1.1.1 format
keys a dictionary for key/value pairs, where the key is a string and the value is in json format
actions a dictionary for stored configurations for actions with a name and configuration key, the name is a string, and the configuration is in json format
logs a list of entries (in json format) for each time a module command has been run (or anything else that a module deems log-worthy) - the list only keeps the latest 50 entries.

actions

Don't store any sensitive information in the configuration, like passwords or api keys.

logs

Don't store any sensitive information in the logs either.

Each log entry returns the following properties, provided or recorded at the time you added the log entry:

timestamp auto-generated timestamp
version version of the module
action action name
configuration action configuration
command the name of the command
started_at timestamp for when the action started
ended_at timestamp for when the action ended
duration auto-generated from ended_at-started_at (in seconds, with decimals)
status status reported upon completion of the action
output the plain text output from running the command