Contents

What is an agent?

An agent is a check that the container performs. Every user needs the opportunity to decide of which errors he wants to be alarmed and which not. So if your container / software checks several different values (for example backup jobs, hardware components, ...), create an agent for each of them.

How to work with an agent.

Every valid PUT, POST or GET request in the /agent namespace returns an agent object.

{
    "settings": [
        {
            "key": "parm1",
            "value": "nutshell",
            "definition": "{\"type\":\"string\"}",
            "orderInt": 0
        }
    ],
    "id": "e853d8f0-1a28-11e3-b5e4-d1e69abc486d",
    "parentId": "7602c7e0-1a26-11e3-aef4-fdaefd669148",
    "name": "Low coffeine level"
}
                    

After the POST request the only thing you need to remember is the id of the agent. You can use that id later to get the agent object again. The OCC stores everything for you.

Before a PUT request you should GET the agent object, manipulate it and send it back to the occ.

How settings work.

Remember that OCC users can change settings if they are not marked with "editable : false". So before every PUT request or container-side setting change, you should read the current settings and the whole agent object using a GET request.
Change the settings within the given object and send it as is back to the OCC using the PUT request.

Note that everytime you send an agent PUT request to the OCC, all settings are dropped and recreated. If you don't provide the "settings" array, no settings will be stored in the OCC and all of the users' setting changes will be lost!