×
Config - Host Group
Object type: hostgroup
Request URL: /rest/config/hostgroup
Example GET Copied
{
"object" : {
"hosts" : [],
"parent" : {
"name" : "Opsview",
"matpath" : "Opsview,",
"ref" : "/rest/config/hostgroup/1"
},
"name" : "Production",
"id" : "2",
"children" : [
{
"name" : "London",
"ref": "/rest/config/hostgroup/7"
},
{
"name" : "Paris",
"ref": "/rest/config/hostgroup/3"
},
{
"name" : "New York",
"ref": "/rest/config/hostgroup/6"
}
],
"uncommitted" : "0",
"matpath" : "Opsview,Production,",
"is_leaf" : 0
}
}
The matpath is a comma separated list of host groups that define this hostgroup’s location in the topology.
The parent contains a the “matpath” attribute to uniquely identify the parent for a host group as it is possible to have duplicated names in the host group hierarchy (from Opsview 3.11.2+).
If you GET with a parameter of order=dependency
, the host groups will be listed based on a traversal of the hierarchy, so the top host group will be first and then it will go down a branch until it comes back up again (from Opsview 3.11.2+).
Take note of the following considerations:
- When PUTing, you cannot change the children - you can only change the topology by amending the parent. Also, the is_leaf and matpath field is calculated, so cannot be changed.
- When PUTing, the name must only include Unicode Letter or Number characters, and any of the following special characters:
./+-_
. - The name column in NOT unique in host groups. Opsview has additional logic so that if you use a name and it cannot be found, then it will search based on the matpath (but the matpath has a 255 character limit). Use the id field where possible as that is unique.
["Opsview On-premises"]
["API", "Technical Reference"]