Skip to content

JobMon API Agent

Brian Brewder edited this page Oct 17, 2016 · 1 revision

An agent in JobMon represents a server that can run instances of JobMon jobs. Native JobMon agents are built as a web application using Node.js and can run on any machine that can run Node.js websites and can execute command-line commands. The purpose of an agent is to install, execute, and uninstall JobMon jobs.

Agent Schema

  • _id: The unique identifier for the document. Set by MongoDB.
  • host: The machine name of the host the agent is installed on. STRING, REQUIRED
  • host_lower: A lower case version of host for more efficient searches. This value must be unique. Set by JobMon. STRING, REQUIRED, UNIQUE
  • hostDetails: The details of a host, can include OS, memory, CPU, etc. STRING
  • url: The URL to the agent. This allows the scheduler to call the agent to start a job. STRING, REQUIRED, UNIQUE
  • enabled: Determines if the agent is enabled or not. Disabling an agent will cause all jobs running on that agent to become disabled. This is useful for machine maintenance purposes. BOOLEAN

GET /api/agents

This will return a list of agents. Can be used with query parameters.

Possible Errors (status 400):

  • QueryError: Error returned by MongoDB due to a problem with the query.

POST /api/agents

Registers an agent in JobMon.

GET /api/agents/{agent._id}

Gets the document for the requested agent.

PATCH /api/agents/{agent._id}

Updates just the supplied values. The only fields that can be updated are the enabled and hostDetails fields. If any other fields need to be changed, remove the old agent and re-register the new one.

DELETE /api/agents/{agent._id}

Removes the agent.

Custom Agent

It is possible to create a custom agent for JobMon. This can be useful if the JobMon agent doesn't do what you would like it to do. For example, you could create an ASP.Net website to act as a JobMon agent and run .Net dlls using an interface that you created.

To build a custom agent, you simply need to register it with a URL that the JobMon scheduler can reach and respond to the calls that the scheduler makes to it, including starting an instance and uninstalling it.

NOTE: Finish documentation for custom agents once the scheduler is created.

Clone this wiki locally