cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Scope Maintenance window by displayName in API

grogers
Contributor
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"
}
}


3 REPLIES 3

wolfgang_beer
Dynatrace Leader
Dynatrace Leader

Display name filter is not possible as of today, but how about to use a tag on the host to achieve this scope?


grogers
Contributor

Okay. I'll probably need to start tagging all me hosts with their hostname to get this working. Thanks.


grogers
Contributor

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.


Featured Posts