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.<br><br>This doesn't work, but illustrates what I'm trying to accomplish:<br><br> {<br> "id":"TestAPIPlannedMW",<br> "type":"Planned",<br> "description":"Test MW created from API",<br> "suppressAlerts":true,<br> "suppressProblems":false,<br> "scope":{<br> "matches": {<br> "type": "HOST",<br> "displayName": "my-server.example.com"<br> }<br> },<br> "schedule":{<br> "type":"Once",<br> "timezoneId":"America/Chicago",<br> "maintenanceStart":"2018-08-01 20:00",<br> "maintenanceEnd":"2018-08-01 20:05"<br> }<br> }<br><br>
Display name filter is not possible as of today, but how about to use a tag on the host to achieve this scope?
Okay. I’ll probably need to start tagging all me hosts with their hostname to get this working. Thanks.
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.