SubstitutionParameter

A SubstitutionParameter element defines a name-value pair that may be referenced in a GSL script once or multiple times. Typically, a SubstitutionParameter will be used to represent a username or a password. The Test Management API now provides a mechanism for updating SubstitutionParameter values whenever necessary. So if the username and password used in GSL script expires, it may be updated without the script having to be reloaded or redeployed.

Derived by

Restricting anyType

Attributes

Name Type Required? Default Description
id string Yes An id (also called a ScriptSession_id) indicates the order in which the SubstitutionParameter was defined in the GSL script. If the GSL script contains three SubstitutionParameters, ids 0, 1, and 2 will be defined. If a site-level substitution parameter is subsequently created, it must have an id that matches one of the ids on the global substitution parameters. For example, if username is defined as the second substitution parameter in a script, its id will be set to 1 both in the global substitution parameter definition and in each site-level username definition.
name string Yes The name provides a human-readable reference to the substitution parameter.
value string Yes The value of the substitution parameter is the text that actually appears in a Script step in place of the Substitution Parameter reference. For example, if a GSL script step references the username substitution parameter, the value of the user name (e.g., "jsmith") is what will be used when the script is executed. In general Substitution Parameter values can be modified. The other data on the Substitution Parameter cannot be updated.
deletionFlag FlagType No Off The deletionFlag is an attribute of the Substitution Parameter that is set only if the Substitution Parameter is to be deleted. Global substitution parameters cannot be deleted via the Test Management API because the Test Management API cannot manage references to Substitution Parameters within the script. However, site-level substitution parameters can be deleted. The effect of deleting a site-level substitution parameter is that the global substitution parameter value will be used.

Content model

Always empty

Referenced by

Example

Here are SubstitutionParameters as they appear in a GetParameterizedTestsResponse:

<GetParameterizedTestsResponse
 xmlns="http://www.gomeznetworks.com/schemas/provisioning">
 <ResponseStatus>SUCCESS</ResponseStatus>
 <!-- 0 to many Parameterized Monitors -->
  <ParameterizedMonitor monitorId="328430"
     createDate="2012-11-13T21:27:29.513"
     modifyDate="2012-11-21T18:57:53.393" monitorStatus="Active">
    <SubstitutionParameters>
      <!-- Global Substitution Parameters -->
      <SubstitutionParameter id="0" name="UserName"
         value="Updated User 11/05/2012 2:56:05 PM"/>
      <SubstitutionParameter id="1" name="Password" value="erics/>
    </SubstitutionParameters>
     <MonitorSites>
       <MonitorSite siteId="865">
        <SubstitutionParameters>
          <!-- Site-level substitution parameters -->
          <SubstitutionParameter id="0" name="UserName" value="user2"/>
          <SubstitutionParameter id="1" name="Password" value="password2"/>
        </SubstitutionParameters>
       </MonitorSite>
       <MonitorSite siteId="880">
        <SubstitutionParameters>
          <!-- Site-level substitution parameters -->
          <SubstitutionParameter id="0" name="UserName" value="user3"/>
          <SubstitutionParameter id="1" name="Password" value="password3"/>
        </SubstitutionParameters>
       </MonitorSite>
     <MonitorSite siteId="886"/>
   </MonitorSites>
  </ParameterizedMonitor>
 </GetParameterizedTestsResponse>

Below is a SubstitutionParameter as it appears in an AddOrUpdateSubstitutionParameters request:

<prov:AddOrUpdateSubstitutionParametersRequest xmlns="http://www.gomeznetworks.com/schemas/provisioning">
  <prov:Credentials>
   <prov:UserName>erics</prov:UserName>
   <prov:Password>erics</prov:Password>
  </prov:Credentials>
  <prov:ParameterizedMonitor monitorId="328430x">
   <prov:SubstitutionParameters>
     <!-- Global parameter value to be updated -->
       <prov:SubstitutionParameter id="0" name="UserName" value="jsmith"/>
     </prov:SubstitutionParameters>
  </prov:ParameterizedMonitor>
</prov:AddOrUpdateSubstitutionParametersRequest>

In the previous example, a global SubstitutionParameter was sent. In the next example, only site-level substitution parameters are sent. The global parameter definitions are not touched.

<prov:AddOrUpdateSubstitutionParametersRequest xmlns="http://www.gomeznetworks.com/schemas/provisioning">
 <prov:Credentials>
  <prov:UserName>erics</prov:UserName>
  <prov:Password>erics</prov:Password>
 </prov:Credentials>
 <!--1 or more repetitions:-->
 <prov:ParameterizedMonitor monitorId="328430">
  <prov:MonitorSites>
    <!--Zero or more repetitions:-->
    <prov:MonitorSite siteId="865">
     <prov:SubstitutionParameters>
      <prov:SubstitutionParameter id="0" name="UserName" value="user2"/>
      <prov:SubstitutionParameter id="1" name="Password" value="password2"/>
     </prov:SubstitutionParameters>
    </prov:MonitorSite>
    <prov:MonitorSite siteId="880">
     <prov:SubstitutionParameters>
     <prov:SubstitutionParameter id="0" name="UserName" value="user3"/>
     <prov:SubstitutionParameter id="1" name="Password" value="password3"/>
    </prov:SubstitutionParameters>
   </prov:MonitorSite>
  </prov:MonitorSites>
 </prov:ParameterizedMonitor>
</prov:AddOrUpdateSubstitutionParametersRequest>

In the final example, a site-level substitution parameter is deleted. It is safe to do this because a global substitution parameter will apply in the absence of the site-level substitution parameter. Global substitution parameters cannot be deleted.

<prov:AddOrUpdateSubstitutionParametersRequest>
   <prov:Credentials>
      <prov:UserName>erics</prov:UserName>
      <prov:Password>erics</prov:Password>
   </prov:Credentials>
   <prov:ParameterizedMonitor monitorId="326334">
      <prov:MonitorSites>
         <prov:MonitorSite siteId="880">
            <prov:SubstitutionParameters>
               <prov:SubstitutionParameter id="1" name="Password" value="foo"
                  deletionFlag="On"/>
            </prov:SubstitutionParameters>
         </prov:MonitorSite>
      </prov:MonitorSites>
   </prov:ParameterizedMonitor>
</prov:AddOrUpdateSubstitutionParametersRequest>