Removing application instance implies removing application 'root' service. When removing the service instance, the Controller must invoke respective configuration script with the remove argument before it removes the application files and deallocates resources used by it, as defined by the Specification in section 5.3.2.1.4 Canceling Service. The Controller must pass to the configuration script all application information transformed into respective environment variables: settings (SETTINGS_<id>), except marked as installation-only; application URL mapping environment variables (if any), as defined by the Specification in section 5.3.2.2. Environment Variables. After configuration script successful execution, the Controller must remove application files and free allocated resources.
If an application package contains separate scripts for application services, it is possible to remove certain service. When user initiates selected service removal, the Controller must check first whether the service has child ones. If child services are present the Controller may remove them or notify the user that service can not be removed due to child services existence and offer their removing. Child services removal procedure completely depends on Controller implementation. To remove a service the Controller must invoke configuration script specified for selected service in the package metadata with the remove argument and pass to it all needed environment variables. After configuration script successful execution, the Controller must remove service URL mapping, service files and free allocated resources.
For details on configuration script invocation, refer to the Configuration Script section earlier in this guide.