Talend Integration Suite Command Line Tutorial

In this tutorial we intend to show how you can use the Talend Integration Suite Command Line to do basic administration commands. This tutorial contains examples on how to connect to the command line and do basic commands such as exporting and importing your projects.

Command Line Installation

This section describes how to install the command line.
(Note: if you have already installed the integration suite in full you can skip this section. These steps are included in installation of the integration suite in the ReadmeADMIN.txt step C)

To install and run the command line follow these steps:
1) Unzip the talend integration suite zip on your computer.

2) Edit commandline.bat or commandline.sh (corresponding to your OS) to point to the correct executable for your plaform
For example if you you have TIS Team Edition on windows the commandline.bat should look like this:
TISTE-win32-x86.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002

3) Launch the previous script

Note: the -p option in the script specifies the port that the command line would use. The default value is 8002. Change this port based on our system to avoid clashing with other applications.

4)You should be represented with a screen that looks like the following:

:doc:commandline_pic1.jpeg

Exporting Projects from the Command Line

In the examples below you will see how to export and import projects from the command line. To get a list of available commands type HELP in the command line.

Exporting a project from the command line:

1) make sure the command line is installed correctly on your systems and is running. For instructions on installing the command line on a known port, refer to the instructions on the previous section on this page. In this example the command line is installed on the local machine on port 8002.

2) create a telnet connection to the command line:
telnet <server ip> <port>
telnet 127.0.0.1 8002

3) initialize a connection to the database containing your projects repository with the initDatabase command:
initDatabase -sn <server name> -sp <server port> -dn <database name> -dl <database login> -dp <password> -dd <database driver: mysql/mssql>
initDatabase -sn localhost -sp 3306 -dn talend_administrator -dl talendadmin -dp TyidP -dd mysql

you will get a response back from the command line that looks like this: ADDED_COMMAND 1

4) log onto an specific project:
logonProject -pn <project name> -ul <user login> -up <password>
logonProject -pn DemoProject -ul admin@company.com -up admin

5) export items from the currect project into a directory or zip file:
exportItems <dir path or zip file path>
exportItems C:/demoProject.zip

6) to export specific items from the project use the IF condition in the exportItems command. For example the command below export the version 0.3 of the job named jobTest:
exportItems C:/jobTest.zip -if (label=jobTest)and(version=0.3)and(type=process)

7) check the status of the inputed commands:
listCommand -a

this command will return the following once all the commands finish executing:
1:COMPLETED InitCommand init dbsa
2:COMPLETED LogonProjectCommand log on DemoProject
3:COMPLETED ExportItemsCommand

Importing Project from Command Line

Importing jobs from the command line is very similar to the exporting example shown above. Example below shows how to import the items that we exported in the previous example into another project. In this example, I have a another project called importProject that I would like to import my items from the previous exmaple into.

1) Create a telnet connection to the command line:

telnet 127.0.0.1 8002

2) Follow these commands:

initDatabase -sn localhost -sp 3306 -dn talend_administrator -dl talendadmin -dp TyidP -dd mysql
logonProject -pn importProject -ul admin@company.com -up admin -buc
importItems C:/demoProject.zip

3) Use the listCommand to get the status of the previous commands:

listCommand -a

Complete List of the Command Line Functions

stopServer                                              stops server
   -f (--force)                                           don't wait for queued commands    
 help                                                       shows help 
 helpFilter                                                shows filter help                    
  showVersion                                          shows product version                
  listCommand                                                lists commands                       
    -a (--all)                                             lists all commands                   
  listJob                                                    lists jobs                           
  listProject                                                lists available projects             
  initLocal                                                  init local repository                
  initDatabase                                               init db repository                   
    -sn (--server-name) hostname                           server name                          
    -sp (--server-port) port                                     server port                          
    -dn (--database-name) name                              database name                        
    -dl (--database-login) login                                 database login                       
    -dp (--database-password) password                  database password                    
    -dd (--database-driver) driver (mysql/mssql)        database driver                      
  initContainer                                              init container repository            
    -ds (--datasource) datasource                          datasource name                      
  logonProject                                               logs on a project                    
      -pn (--project-name) technical name                    project name                         
      -ul (--user-login) login                               user login                           
      -up (--user-password) password                         user password                        
      -buc (--bypass-user-ckeck)                             bypass user auth and pass check      
  createProject                                              creates a project                    
      -pn (--project-name) technical name                    project name                         
      -pd (--project-description) description                project description                  
      -pl (--project-language) language (java/perl)          project language                     
      -pa (--project-author) author login                    project author                       
  executeAllJob                                              executes all                         
      -i (--interpreter) path                                perl/java interpreter path           
      -jcp (--job-context-param) key=value [key=value ...]   provides a job context param         
      -jrdd (--job-result-destination-dir) path              job execution result destination dir 
      -jt (--job-timeout) time (in sec)                      timeout of execution                 
  exportAllJob                                               exports all                          
      -dd (--destination-directory) path                     destination directory                
  executeJob jobName                                         executes                             
      -i (--interpreter) path                                perl/java interpreter path           
      -jv (--job-version) version                            chooses a job version                
      -jc (--job-context) context name                       chooses a job context               
      -jcp (--job-context-param) key=value [key=value ...]   provides a job context param         
      -jrdd (--job-result-destination-dir) path              job execution result destination dir 
      -jt (--job-timeout) time (in sec)                      timeout of execution                 
  exportJob jobName                                          exports                              
      -dd (--destination-directory) path                     destination directory                
      -jv (--job-version) version                            chooses a job version                
      -jc (--job-context) context name                       chooses a job context                
      -af (--archive-filename) filename                      archive filename (without .zip)      
  getCommandStatus commandId                                 gets command status                  
  importItems source (dir|.zip)                              imports items                        
      -if (--item-filter) filterExpr                         item filter expression               
  exportItems destination (dir|.zip)                         exports items                        
      -if (--item-filter) filterExpr                         item filter expression               
  changeVersion newVersion                                   changes items version                
      -if (--item-filter) filterExpr                         item filter expression               
  changeStatus newStatusCode                                 changes items status                 
      -if (--item-filter) filterExpr                         item filter expression               
  importDatabaseMetadata filePath                            imports database metadata            
  importDelimitedMetadata filePath                           imports delimited metadata           
 
doc/command_line.txt · Last modified: 2011/12/17 03:52 (external edit)
 
 
Recent changes RSS feed Driven by DokuWiki