Deleting an environment by using an Ant task

You can delete an environment and its associated artifacts by using the HCL Quality Server Ant tasks.
Here is an example syntax:
<taskdef name="deleteEnvironment" classname="com.ghc.ghTester.ant.DeleteEnvironment" classpathref="tasklib" />

<deleteEnvironment domain="<Domain name>" environment="<Environment name>" 
serverUrl="https://Host name or IP address:5443/RTCP/" username="<User name>" 
securityToken="<Security token>" />
The following example usage files for the Ant tasks are available in the package that can be downloaded from HCL Quality Server. For more information, see HCL OneTest™ API tool packages.
  • create-update-delete-environment.xml
  • lock-unlock-environment.xml
  • publish-stubs.xml
  • start-stop-scenario.xml
  • start-stop-stub.xml

The following table lists the attributes that you can use with the deleteEnvironment Ant task for deleting an environment.

Table 1. List of available attributes
Attribute Description Required
serverUrl URL of the HCL Quality Server Yes
domain Domain name Yes
environment Environment name Yes
username The user name under which to perform the operation. No
securityToken The value of the security token to use for authentication with HCL Quality Server when domain security is enabled (optional). For more information, see Domain level security. No, default is to send no token.
  • force
  • forceIf
  • forceUnless
Use the force option to delete an environment by attempting to ignore any warnings or errors that might occur.
  • force: To ignore all the problems that occur when you delete an environment.
  • forceIf: Specify a space-separated list of problem identifiers to ignore when you delete an environment.
  • forceUnless: Specify a space-separated list of problem identifiers to not ignore while deleting an environment. If the parameter list is empty, the force setting is not considered and none of the errors are ignored.
You can specify if a specific problem identifier must either be ignored or considered when the environment is deleted. Following are the problem identifier parameters:
  • stubs-running: Indicates that stubs are running in the environment.
  • environment-locked: Indicates that the environment is locked.
  • proxy-rules: Indicates that there are proxy rules that apply to a proxy registered with that environment.
<property name="force" value="false"/>
<property name="forceIf" value="stubs-running"/>
<property name="forceUnless" value="environment-locked"/>
Note: All environment deletion events are recorded in the HCL Quality Server Audit log. (For information about this log, refer to Administering HCL Quality Server.)

Error codes

For details of any error codes, see Exit codes for Command-line client and Ant client.