28 Oct 2022 08:18 AM - last edited on 12 Dec 2022 11:49 AM by Ana_Kuzmenchuk
Hi,
we are trying to automate some manual actions. One of them is to enable MW when a server-planned restart is running, using API with playbooks.
We have defined a new MW for this case.
I suppose now we have to define two actions, enable/disable it, but not sure how to do it.
We run Get All Objects and obtain our MW:
_________________________________________________________________________
"objectId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"value": {
"enabled": false,
"generalProperties": {
"name": "Ventana reinicio",
"maintenanceType": "UNPLANNED",
"suppression": "DETECT_PROBLEMS_DONT_ALERT",
"disableSyntheticMonitorExecution": false
},
"schedule": {
"scheduleType": "ONCE",
"onceRecurrence": {
"startTime": "2022-10-27T10:26:00",
"endTime": "2022-10-27T11:26:00",
"timeZone": "UTC"
}
},
"filters": [
{
"entityType": "SYNTHETIC_TEST",
"entityTags": [
"XXXX"
],
"managementZones": []
},
{
"entityType": "PROCESS_GROUP",
"entityTags": [
"ENVIRONMENT:PRO",
"APP:XXXX"
],
"managementZones": []
}
]
___________________________________________________________
-Enable:
"enabled": true,
"startTime": "now()",
"endTime": "now()+1",
-Disable:
"enabled": false,
How should I write this??
Regards
Solved! Go to Solution.
10 Jan 2023 09:38 PM
I recommend defining it out via the UI then using the API to pull the code for the MW. Then one could always just update the end time.
We integrated with the CICD Pipeline for servers so the users use a template and supply the host name, the start and end date/time then posts it.
Terraform also leverages a pretty cool integration as deployment as code.