01 Aug 2018 08:58 PM
I'm looking to give my SysAdmins a 1 line curl script to create one-time maintenance windows for reboots. Is there a way I can set scope based on displayName rather than entityID or tags? I'm doubtful that my sysadmins will know the entityID of a host, but they will know hostname, which corresponds to displayName in our environment.
This doesn't work, but illustrates what I'm trying to accomplish:
{
"id":"TestAPIPlannedMW",
"type":"Planned",
"description":"Test MW created from API",
"suppressAlerts":true,
"suppressProblems":false,
"scope":{
"matches": {
"type": "HOST",
"displayName": "my-server.example.com"
}
},
"schedule":{
"type":"Once",
"timezoneId":"America/Chicago",
"maintenanceStart":"2018-08-01 20:00",
"maintenanceEnd":"2018-08-01 20:05"
}
}
Solved! Go to Solution.
02 Aug 2018 06:43 AM
Display name filter is not possible as of today, but how about to use a tag on the host to achieve this scope?
02 Aug 2018 02:03 PM
Okay. I'll probably need to start tagging all me hosts with their hostname to get this working. Thanks.
03 Aug 2018 03:49 PM
Short follow-up, I created an Automatic Tag to add a Host:displayName tag to hosts, and can now easily create Maintenance windows for my hosts.