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

Maintenance window Via Api

Malaik
DynaMight Champion
DynaMight Champion

Hi All,

Can some provide example for building maintenance window via API with the new mode?

 

The bellow way seems to be removed and routed to the second one, but not too easy to use:

Malaik_0-1653823869447.png

 

Have a nice day.

 

Sharing Knowledge
3 REPLIES 3

mark_bley
Dynatrace Pro
Dynatrace Pro

Hi Malaik,

 

you can try following against the /api/v2/settings/objects endpoint

[
    {
        "schemaId": "builtin:alerting.maintenance-window",
        "scope": "environment",
        "value": {
            "enabled": true,
            "generalProperties": {
                "name": "Example Window",
                "description": "An example Maintenance window",
                "maintenanceType": "UNPLANNED",
                "suppression": "DETECT_PROBLEMS_AND_ALERT",
                "disableSyntheticMonitorExecution": true
            },
            "schedule": {
                "scheduleType": "MONTHLY",
                "monthlyRecurrence": {
                    "dayOfMonth": 1,
                    "timeWindow": {
                        "startTime": "13:45:00",
                        "endTime": "14:45:00",
                        "timeZone": "Europe/Vienna"
                    },
                    "recurrenceRange": {
                        "scheduleStartDate": "2022-04-01",
                        "scheduleEndDate": "2022-05-26"
                    }
                }
            },
            "filters": [
                {
                    "entityType": "HOST",
                    "entityTags": [
                        "[AWS]testkey:testvalue"
                    ]
                },
                {
                    "entityType": "HOST",
                    "entityId": "HOST-0A7500C12EB9471D",
                    "entityTags": [],
                    "managementZones": []
                }
            ]
        }
    }
]

 Make sure the version defined in the payload matches the one you also see in your environment

mark_bley_1-1654698033498.png

Hope this helps.

Best,

Mark

 

 

Malaik
DynaMight Champion
DynaMight Champion

Thanks @mark_bley 

Solution found last time, thanks for your comment.

 

Just a comment, where can I get the view for schema version.

Sharing Knowledge

techean
Dynatrace Champion
Dynatrace Champion

Featured Posts