Deploy a test to a new Backbone site (UpdateTests, UpdateTestParameters)

The API for site management is declarative, not imperative. It is not necessary to explicitly add a site to or delete a site from a browser test. Rather you can update the test’s site collection. If the updated site collection contains a site to which the browser test is not currently deployed, the system will determine that the new monitor-site relation needs to be created and will create it automatically.

The UpdateTests method of update requires you to first get an up-to-date snapshop of the test by calling GetTests(), filtering if possible its output by MonitorId. The Monitor element returned by this query contains a site collection which can be augmented on the update. Call GetSites() to get a listing of all the sites available to account where the update is to occur.

In this example, a test is created to run only on a single Backbone node (884):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:ProvisionTestsRequest>
         <prov:Credentials>
            <prov:UserName>MyUser</prov:UserName>
            <prov:Password>MyPassword</prov:Password>
         </prov:Credentials>
         <prov:SingleStepMonitors>
            <prov:SingleStepMonitor agentType="FF"
                                    name="eg_2012-08-16T13:11:50.460_FF 2"
                                    folder="ws_provision"
                                    frequencyInMins="5"
                                    monitorStatus="Active">
               <prov:MonitorSites>
                  <prov:MonitorSite siteId="884"/>
               </prov:MonitorSites>
               <prov:URL>http://www.google.com</prov:URL>
            </prov:SingleStepMonitor>
         </prov:SingleStepMonitors>
      </prov:ProvisionTestsRequest>
   </soapenv:Body>
</soapenv:Envelope>

To modify this same test to run on multiple nodes, get the latest snapshot of the test using the following GetTests() query:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:GetTestsRequest>
         <prov:Credentials>
            <prov:UserName>MyUser</prov:UserName>
            <prov:Password>MyPassword</prov:Password>
         </prov:Credentials>
	<prov:MonitorFilter>
		<prov:MonitorId>306528</prov:MonitorId>
	</prov:MonitorFilter>
      </prov:GetTestsRequest>
   </soapenv:Body>
</soapenv:Envelope>

The following is the response to this query:

<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>
      <GetTestsResponse xmlns="http://www.gomeznetworks.com/schemas/provisioning">
         <ResponseStatus>SUCCESS</ResponseStatus>
         <Monitors>
            <Monitor name="eg_2012-08-16T13:11:50.460_FF 2"
                     folder="ws_provision"
                     agentType="FF"
                     summaryFlag="Off"
                     includeRenderTimeFlag="Off"
                     frequencyInMins="5"
                     ipVersion="IPv6_preferred"
                     monitorStatus="Active"
                     folderStatus="Active"
                     monitorId="306528"
                     createDate="2012-08-16T18:58:17.513"
                     modifyDate="2012-08-16T18:58:17.52"
                     scriptId="306528">
               <MonitorSites>
                  <MonitorSite siteId="884"/>
               </MonitorSites>
               <Steps>
                  <Step stepSeqNum="0">
                     <URL>http://www.google.com</URL>
                     <DisplayName/>
                  </Step>
               </Steps>
            </Monitor>
         </Monitors>
      </GetTestsResponse>
   </soap:Body>
</soap:Envelope>

By augmenting the MonitorSite list on an update, this same test can be deployed to more nodes.

Get the list of available nodes using the GetSites() query.

Then, augment the MonitorSite list as follows:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:UpdateTestsRequest>
         <prov:Credentials>
            <prov:UserName>MyUser</prov:UserName>
            <prov:Password>MyPassword</prov:Password>
         </prov:Credentials>
         <prov:Monitors>
            <prov:Monitor name="eg_2012-08-16T13:11:50.460_FF 2"
                          folder="ws_provision"
                          agentType="FF"
                          summaryFlag="Off"
                          includeRenderTimeFlag="Off"
                          frequencyInMins="5"
                          ipVersion="IPv6_preferred"
                          monitorStatus="Active"
                          folderStatus="Active"
                          monitorId="306528"
                          createDate="2012-08-16T18:58:17.513"
                          modifyDate="2012-08-16T18:58:17.52"
                          scriptId="306528">
               <prov:MonitorSites>
                  <prov:MonitorSite siteId="884"
                                    siteName="TPNTS10 - Boston, MA - Savvis"
                                    city="Boston"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="885"
                                    siteName="TPNTS9 - Boston, MA - Savvis"
                                    city="Boston"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="886"
                                    siteName="TPNTS8 - Boston, MA - Savvis"
                                    city="Boston"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="887"
                                    siteName="TPNTS11 - Boston, MA - Savvis"
                                    city="Boston"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="true"/>
               </prov:MonitorSites>
               <prov:Steps>
                  <prov:Step stepSeqNum="0">
                     <prov:URL>http://www.google.com</prov:URL>
                     <prov:DisplayName/>
                  </prov:Step>
               </prov:Steps>
            </prov:Monitor>
         </prov:Monitors>
      </prov:UpdateTestsRequest>
   </soapenv:Body>
</soapenv:Envelope>

The UpdateTestParameters() method allows you to perform site management on a browser test without getting a snapshot of the test from the system and without traversing any code paths not related to site management.

Here is an example of site management using the UpdateTestParameters method:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:UpdateTestParametersRequest>
         <prov:Credentials>
            <prov:UserName>MyUser</prov:UserName>
            <prov:Password>MyPassword</prov:Password>
         </prov:Credentials>
         <!--1 or more repetitions:-->
         <prov:PartialUpdate monitorId="270276">
            <prov:MonitorSites>
                  <prov:MonitorSite siteId="777"
                                    siteName="TPNTS7 - MA: Boston"
                                    city="Lexington"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="865"
                                    siteName="TPNPEKSA12 - Beijing China test"
                                    city="Beijing"
                                    state=""
                                    countryCode="CN"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="866"
                                    siteName="TPNPEKSA02 - Beijing China test"
                                    city="Beijing"
                                    state=""
                                    countryCode="CN"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="867"
                                    siteName="TPNTS18 - Boston, MA - Savvis"
                                    city="Waltham"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
                  <prov:MonitorSite siteId="868"
                                    siteName="TPNTS17 - Boston, MA - Savvis"
                                    city="Waltham"
                                    state="MA"
                                    countryCode="US"
                                    ipV6Enabled="false"/>
            </prov:MonitorSites>
         </prov:PartialUpdate>
      </prov:UpdateTestParametersRequest>
   </soapenv:Body>
</soapenv:Envelope>