Map
The map resource provides mapping between numerical ids and names for various objects in the system. The resource is accessible via the /api/2/map
URL, which dumps the whole tree. You can also query a particular branch of the tree.
Two large subtrees are available, /api/2/map/name
(name-to-id mapping) and the reverse, /api/2/map/id
(id-to-name mapping). You can drill-down on these branches by using a more specific path (see below).
In addition to these maps, there are subtrees which provide more complex object maps, such /api/2/map/service
, /api/2/map/servicegroup
, /api/2/map/event
and /api/2/map/user
.
Note: This API is mainly for internal use, but you might also find it useful.
Maps overview:
GET POST |
/api/2/map | The whole map tree |
GET POST |
/api/2/map/id | The map-id subtree |
GET POST |
/api/2/map/name | The map-name subtree |
id-to-name maps | ||
GET POST |
/api/2/map/id/action | Action types list |
GET POST |
/api/2/map/id/host | Host list |
GET POST |
/api/2/map/id/hostgroup | Hostgroup list |
GET POST |
/api/2/map/id/hostmachine | Host machine list |
GET POST |
/api/2/map/id/hostplatform | Host platform list |
GET POST |
/api/2/map/id/hoststatus | Host status types list |
GET POST |
/api/2/map/id/operator | Operator types list |
GET POST |
/api/2/map/id/permission | Permission types list |
GET POST |
/api/2/map/id/range | Range types list |
GET POST |
/api/2/map/id/servicetype | Service types list |
GET POST |
/api/2/map/id/statetype | Service state types list |
GET POST |
/api/2/map/id/statisticstype | Statistics type list |
name-to-id maps | ||
GET POST |
/api/2/map/name/action | Action types list |
GET POST |
/api/2/map/name/host | Host list |
GET POST |
/api/2/map/name/hostgroup | Hostgroup list |
GET POST |
/api/2/map/name/hostmachine | Host machine list |
GET POST |
/api/2/map/name/hostplatform | Host platform list |
GET POST |
/api/2/map/name/hoststatus | Host status types list |
GET POST |
/api/2/map/name/operator | Operator types list |
GET POST |
/api/2/map/name/permission | Permission types list |
GET POST |
/api/2/map/name/range | Range types list |
GET POST |
/api/2/map/name/servicetype | Service types list |
GET POST |
/api/2/map/name/statetype | Service state types list |
GET POST |
/api/2/map/name/statisticstype | Statistics types list |
Misc maps | ||
GET POST |
/api/2/map/event | Event types |
GET POST |
/api/2/map/user | User list |
GET POST |
/api/2/map/user/remote | Logged in user as remote-user |
GET POST |
/api/2/map/service | Service list |
GET POST |
/api/2/map/servicegroup | Service group list |
Arguments
none |
Example1
Query the id-to-name hosts sub-tree and list all registered hosts
curl -b ~/.mmonit/cookie \
https://127.0.0.1:8080/api/2/map/id/host
{
"map":{
"id":{
"host":{
"1":"solaris11-x64",
"5":"debian4-x86",
"6":"debian4-x64",
"8":"freebsd80-x86",
"9":"freebsd80-x64",
"54213":"netbsd6-x64",
"13":"tildeslash1",
"49104":"wordpress"
}
}
}
}
Example2
Query the reverse name-to-id hosts sub-tree
curl -b ~/.mmonit/cookie \
https://127.0.0.1:8080/api/2/map/name/host
{
"map":{
"name":{
"host":{
"solaris11-x64":"1",
"debian4-x86":"5",
"debian4-x64":"6",
"freebsd80-x86":"8",
"freebsd80-x64":"9",
"netbsd6-x64":"54213",
"tildeslash1":"13",
"wordpress":"49104"
}
}
}
}