This recipe guides you through discovering the structure and content of your PDI repository using the PDI command-line tools. We can know anything about the repository from the command line: we can view the list of available repositories, or view the list of directories in the repository, view the list of jobs or transformations in the specified directory. This recipe will work the same for both Kitchen and Pan, with the exception of the listing of jobs and transformations in a repository's directory; the first works with Kitchen and the second with Pan.
To get ready for this recipe, you need to check that the JAVA_HOME
environment variable is set properly and then configure your environment variables so that the Kitchen script can start from anywhere without specifying the complete path to your PDI home directory. For details about these checks, refer to the recipe Executing PDI jobs from a filesystem (Simple).
To get the list of the available repositories, perform the following steps:
listrep
command-line argument.$ kitchen.sh –listrep
C: empsamples>Kitchen.bat /listrep
INFO 19-03 23:18:51,675 - Kitchen - Start of run. INFO 19-03 23:18:51,695 - RepositoriesMeta - Reading repositories XML file: /home/sramazzina/.kettle/repositories.xml List of repositories: #1 : sample3 [PDI Book Samples] id=KettleFileRepository
To get the list of directories in a selected repository, perform the following steps:
listdir
argument used together with the following arguments:rep
argument, to specify the name of the repository where we want to display the internal directory structure.dir
argument, to give the directory name's starting point. The command will show you the directories contained in a specific directory. If this argument has not been specified, PDI assumes that you want to show all the directories contained in the root directory. Navigating through the structure of a complex repository is quite a tedious and iterative process, but something is better than nothing!user
and –pass
arguments, in case your repository is an authenticated repository, to specify the username and password that needs to be connected to.rep3
, the command to fire on Linux/Mac is as follows:$ kitchen.sh –rep:sample3 –listdir
rep3
, the command to fire on Windows is as follows:C: empsamples>Kitchen.bat /rep:sample3 /listdir
INFO 20-03 07:07:17,236 - Kitchen - Start of run. INFO 20-03 07:07:17,252 - RepositoriesMeta - Reading repositories XML file: /home/sramazzina/.kettle/repositories.xml dir2 dir1
dir1
has a subdirectory, subdir11
; to show this directory, we need to specify another command that for Linux/Mac is as follows:$ kitchen.sh –rep:sample3 –dir:dir1 –listdir
And for Windows, the command is as follows:
C: empsamples>Kitchen.bat /rep:sample3 /dir:dir1 /listdir
dir1
as follows:INFO 20-03 07:07:34,324 - Kitchen - Start of run. INFO 20-03 07:07:34,339 - RepositoriesMeta - Reading repositories XML file: /home/sramazzina/.kettle/repositories.xml subdir11
$ kitchen.sh –user:pdiuser –pass:password –rep:sample3 –listdir
And the command will change as follows for Windows:
C: empsamples>Kitchen.bat /user:pdiuser /pass:password /rep:sample3 /listdir
To get the list of jobs in a specified directory, perform the following steps:
listjob
. This argument must be used together with the following:rep
argument, to specify the name of the repository where we want to display the internal directory structure.dir
argument, to give the name of the directory. The command will show you the jobs contained in a specific directory. If this argument is not specified, PDI assumes that you want to show all the jobs contained in the root directory.user
and pass
arguments, in case your repository is an authenticated repository, to specify the username and password that needs to be connected to.rep3
, the command to fire on Linux/Mac is as follows:$ kitchen.sh –rep:sample3 –listjobs
rep3
, the command to fire on Windows is as follows:C: empsamples>Kitchen.bat /rep:sample3 /listjobs
INFO 20-03 07:30:46,642 - Kitchen - Start of run. INFO 20-03 07:30:46,657 - RepositoriesMeta - Reading repositories XML file: /home/sramazzina/.kettle/repositories.xml export-job
$ kitchen.sh –user:pdiuser –pass:password –rep:sample3 –listjobs
C: empsamples>Kitchen.bat /user:pdiuser /pass:password /rep:sample3 /listjobs
To get the list of transformations in a specified directory, perform the following steps:
–listtrans
argument together with the same arguments specified for the –listjobs
argument; for details about this, please refer to the previous paragraph to get a detailed explanation of the meaning and syntax of those arguments.rep3
, the command to fire on Linux/Mac is as follows:$ pan.sh –rep:sample3 –listtrans
rep3
, the command to fire on Windows is as follows:C: empsamples>Pan.bat /rep:sample3 /listtrans
INFO 20-03 07:35:10,073 - Pan - Start of run. INFO 20-03 07:35:10,103 - RepositoriesMeta - Reading repositories XML file: /home/sramazzina/.kettle/repositories.xml read-customers