While the Test Management API does not provide a specific method for deleting a recurring maintenance window, you can easily obtain this goal. The
AddOrUpdateMaintenanceWindows request will purge the existing maintenance window(s) in favor of the new maintenance windows that you specify. Consequently, to delete a recurring maintenance window, you must retrieve the current collection of recurring maintenance windows for the monitor and then send a new
AddOrUpdateMaintenanceWindows request into the system with the maintenance window to delete omitted from the collection.
This interface is similar to the one provided to manage the deployment of tests to monitor sites in the Test Management API.
Consider the case where the returned set of maintenance windows contains the following:
To delete the Sunday maintenance window, send the following
Since this request does not include the Sunday maintenance window definition, and one exists in the system, the Sunday definition is purged from the system by the request. However, the existing Saturday definition is also purged and recreated by this request. The net result is that one window definition is purged.