search

Anatomy of an API request

Router URL

Routers are exposed in Zenoss Resource Manager and Collection Zones via router endpoint URLs. Each router is available at a distinct URL. See the following chart for some common router endpoints:

Router NameRouter Endpoint URL

DeviceRouter

/zport/dmd/device_router
EventsRouter

/zport/dmd/evconsole_router

JobsRouter

/zport/dmd/jobs_router

ImpactRouter

/zport/dmd/enterpriseservices_router

HTTP Headers

Content-Type

The Content-Type must be set to Application/json

Authorization

Authorization (a username and password or API key) need to be present in the headers of your API request.

Payload

Action

Routers require an action field to be defined, which is typically the name of the router being leveraged.

Method

When making an API call, the method being invoked needs to be specified in the router request's method field. 

Data

Most router methods accept, or even require, other pieces of information. Arguments used by router methods are passed in the data field.

TID

A tid is a temporary transaction ID for a router request.


Example API Request


Example JSON Payload

{
   "action":"DeviceRouter",
   "method":"addDevice",
   "data":{
      "deviceName":"example-device.zenoss.com",
      "deviceClass":"/Server/Linux",
      "productionState":"1000"
   },
   "tid":"1"
}