Adding a one-time maintenance window to a monitor

When you add one-time maintenance windows to a monitor through the API, all pre-existing one-time maintenance windows are overwritten. For this reason, it is important to include in your addition all existing one-time maintenance window definitions. Therefore, before performing the addition, issue a query such as the following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:GetMaintenanceWindowsRequest>
         <prov:Credentials>
            <prov:UserName>testuser</prov:UserName>
            <prov:Password>testpassword</prov:Password>
         </prov:Credentials>
         <!--Optional:-->
         <prov:MaintenanceWindowFilter>
            <prov:MaintenanceWindowType>ONE_TIME</prov:MaintenanceWindowType>
            <prov:MonitorIds>
               <prov:MonitorId>328060</prov:MonitorId>
            </prov:MonitorIds>
         </prov:MaintenanceWindowFilter>
      </prov:GetMaintenanceWindowsRequest>
   </soapenv:Body>
</soapenv:Envelope>

Any one-time maintenance window definitions that have not yet expired should be included in the AddOrUpdateMaintenanceWindows request when the new one-time maintenance window definition is added. The following is a sample request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:AddOrUpdateMaintenanceWindowsRequest>
         <prov:Credentials>
            <prov:UserName>testuser</prov:UserName>
            <prov:Password>testpassword</prov:Password>
         </prov:Credentials>
         <!--1 or more repetitions:-->
         <prov:MaintenanceWindowMonitor monitorId="263717">
            <!--Optional:-->
            <prov:OneTimeMaintenaneWindows>
               <!--Zero or more repetitions:-->
               <prov:OneTimeMaintenanceWindow beginDate="2012-11-09T15:03:42"
                                              endDate="2012-11-10T18:03:42"/>
               <prov:OneTimeMaintenanceWindow beginDate="2012-11-15T15:03:42"
                                              endDate="2012-11-16T18:03:42"/>
            </prov:OneTimeMaintenaneWindows>
         </prov:MaintenanceWindowMonitor>
      </prov:AddOrUpdateMaintenanceWindowsRequest>
   </soapenv:Body>
</soapenv:Envelope>

In this example, the 11/9 maintenance window is the pre-existing maintenance window, and the 11/16 maintenance window is the new one. The net result of injecting this message into the system is to add one new maintenance window while preserving the old one. However, if the 11/9 maintenance didn't exist when the message was sent, it would be created.