Adding one or more maintenance Windows to multiple monitors

You can apply the same maintenance window definitions to multiple monitors. The Test Management API also provides a convenient way to do this. The web method in question is called ApplyMaintenanceWindowTemplateToMonitors. A sample request appears below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:ApplyMaintenanceWindowTemplateRequest>
         <prov:Credentials>
            <prov:UserName>erics</prov:UserName>
            <prov:Password>erics</prov:Password>
         </prov:Credentials>
         <prov:MonitorIds>
            <prov:MonitorId>326334</prov:MonitorId>
            <prov:MonitorId>328141</prov:MonitorId>
            <prov:MonitorId>328196</prov:MonitorId>
         </prov:MonitorIds>
         <prov:RecurringMaintenanceWindows>
               <prov:RecurringMaintenanceWindow dayOfWeek="SUN"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="MON"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="TUE"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="WED"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="THU"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="FRI"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
               <prov:RecurringMaintenanceWindow dayOfWeek="SAT"
                                                startTime="03:00:00.0000000-05:00"
                                                endTime="04:00:00.0000000-05:00"/>
         </prov:RecurringMaintenanceWindows>
      </prov:ApplyMaintenanceWindowTemplateRequest>
   </soapenv:Body>
</soapenv:Envelope>

In the previous example, seven recurring maintenance windows (one for each day of the week) are added to three monitors. The same kind of operation can be performed with one-time maintenance window definitions; see the following example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:ApplyMaintenanceWindowTemplateRequest>
         <prov:Credentials>
            <prov:UserName>testuser</prov:UserName>
            <prov:Password>testpassword</prov:Password>
         </prov:Credentials>
         <prov:MonitorIds>
            <prov:MonitorId>326334</prov:MonitorId>
            <prov:MonitorId>328141</prov:MonitorId>
            <prov:MonitorId>328196</prov:MonitorId>
         </prov:MonitorIds>
         <prov:OneTimeMaintenanceWindows>
              <prov:OneTimeMaintenanceWindow beginDate="2012-11-15T15:03:42"
                                             endDate="2012-11-10T18:03:42"/>
              <prov:OneTimeMaintenanceWindow beginDate="2012-11-16T15:03:42"
                                             endDate="2012-11-16T18:03:42"/>
              <prov:OneTimeMaintenanceWindow beginDate="2012-11-17T15:03:42"
                                             endDate="2012-11-16T18:03:42"/>
          </prov:OneTimeMaintenanceWindows>
      </prov:ApplyMaintenanceWindowTemplateRequest>
   </soapenv:Body>
</soapenv:Envelope>

The following is a sample response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <ApplyMaintenanceWindowTemplateResponse
           xmlns="http://www.gomeznetworks.com/schemas/provisioning">
         <ResponseStatus>SUCCESS</ResponseStatus>
      </ApplyMaintenanceWindowTemplateResponse>
   </soap:Body>
</soap:Envelope>

Note

The response looks the same, regardless of what kind of maintenance window was applied.

These operations create a distinct set of maintenance windows for each monitor listed in the request. All maintenance windows are defined at the account level.

The ApplyMaintenanceWindowTemplateToMonitors method is implemented in a declarative fashion. Whatever maintenance windows are passed in the request will replace whatever was there before. If the use wants to add new maintenance windows of a given type without purging the original definitions, the new request must incorporate the maintenance window definitions that were originally there. However, if one is adding new recurring maintenance windows only, already existing one-time maintenance window definitions will not be touched. Likewise, if one is adding one-time maintenance windows only, the already existing recurring maintenance window definitions will not be touched.