In the case of my internship, my job is to “automate” the deployement of maintenance windows without using the web interface.
As I’m beginner with Dynatrace, I was wondering how to use the Dynatrace’s API to deploy a maintenance window ?
Furthermore, if you can give a detailled example of how to use the API, it would be great as I don’t really understand how to use the endpoint or anything else.
If you generated access token you have to click on your user icon in top right corner, then go to Environment API v2. Search for Settings – Objects and Settings – Schemas. This is your default tool to interact with Dynatrace API (of course you can use another tool like Postman if you want). Before you can use it you have to authorize yourself by clocking on locker icon and pass your previously generated token. Through button “Try it out” you can run your queries.
To work with maintenance windows you use schema: builtin:alerting.maintenance-window.
As I see, it appears I can only use “GET” methods to manipulate Maintenance Windows. Are “POST” methods available to create and deploy Maintenance Windows ?
As I see, I can deploy a maintenance window thanks to monaco. What I need to do is just to construct a YAML file to fit with all needed paramaters for a maintenance window, am I right ?
If it’s the case, how should I find the structure to edit and put into the YAML file ?