Skip to main content Skip to complementary content

Building a stop() script

Procedure

  1. Write the requestUndeployEsbTask script below to request Talend Runtime to undeploy ESB task specified in script:
    
    echo $"Un-deploying Talend ESB Task ...."
    # Read environment variable $esbtaskId.
    source /etc/environment
                        
    # Build MetaServlet JSON script – requestUndeployEsbTask.
    metaservlet='{"actionName": "requestUndeployEsbTask","authPass": "admin","authUser": "admin@company.com","taskId": '$esbtaskId'}'
                        
    # Run base64url.sh to encode “requestDeployEsbTask” script within Base64.
    metaservlet=`echo "$metaservlet" | /app/base64url.sh`
                        
    # Execute REST Call to TAC MetaServlet with encoded string.
    curl -s 'http://{TACHost}:8080/org.talend.administrator/metaServlet?' -X POST -H 'Content-Type: application/json' -d "$metaservlet"
                    
  2. Write the deleteEsbTask script below to delete undeployed ESB tasks.
    
    echo $"Deleting Talend ESB Task ...."
                        
    # Build MetaServlet JSON script – deleteEsbTask, with $esbtaskId previously reading from environment variables
    metaservlet='{"actionName": "deleteEsbTask","authPass": "admin","authUser": "admin@company.com","taskId": '$esbtaskId'}'
                        
    # Run base64url.sh to encode “requestDeployEsbTask” script within Base64.
    metaservlet=`echo "$metaservlet" | /app/base64url.sh`
                        
    # Execute REST Call to TAC MetaServlet with encoded string.
    curl -s 'http://{TACHost}:8080/org.talend.administrator/metaServlet?' -X POST -H 'Content-Type: application/json' -d "$metaservlet"
                    
  3. Write the removeServer script below to remove Talend Runtime server declaration from Talend Administration Center:
    echo $"Remove Talend Runtime server from TAC ...."
                            
    # Build MetaServlet JSON script – removeServer, with $serverId previously reading from environment variables
    metaservlet='{"actionName": "removeServer","authPass": "admin","authUser": "admin@company.com","serverId": '$serverId'}'
                            
    # Run base64url.sh to encode “requestDeployEsbTask” script within Base64.
    metaservlet=`echo "$metaservlet" | /app/base64url.sh`
                            
    # Execute REST Call to TAC MetaServlet with encoded string.
    curl -s 'http://{TACHost}:8080/org.talend.administrator/metaServlet?' -X POST -H 'Content-Type: application/json' -d "$metaservlet"
                        

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!