The Command Line Interface (CLI) to TDI, called the tdisrvctl utility, is designed for remotely managing Configs, AssemblyLines, and so on. This utility connects to a remote TDI server using the Remote Server API, and performs the requested operations. As it is a client application interfacing to a Remote Server, it is subject to the same connection, authentication and authorization issues described in Security and TDI.
It exposes various command line options for the following functions:
Notes:
The command has the following usage:
tdisrvctl [general_options] -op operation [operation_specific_options]
-h host | Enter the remote server IP address or hostname (default is localhost). |
-K keystore | Enter the name of the SSL key database file. |
-p port | Enter the port number (default is 1099). |
-P key_pwd | Enter the key file password. |
-s | Specifiy the working directory where the solution directory is located. |
-T truststore | Enter the name of the SSL truststore database file. |
-u userID | Enter the username (for custom authentication). |
-v | Run in verbose mode. |
-w user_pwd | Enter the user password (for custom authentication). |
-W trust_pwd | Enter the trust file password. |
-? | Display command usage. |
event | Send custom notification events |
prop | Manage Config properties |
queryop | Query for AssemblyLine (AL) operations |
reload | Reload running Configs |
report | Generate Config report or list Configs on remote server |
shutdown | Shutdown the server |
srvinfo | View TDI server information |
status | View status of Configs or ALs |
start | Start specific Config or ALs |
stop | Stop specific Config or ALs |
tombstone | View tombstone entries for specific Config or AL. |
deletetombstone | delete a tombstone entry |
debug | debug components of a running AssemblyLine |
We can display help for any particular option like this:
tdisrvctl -op operation -?
The usage for the event operation is:
tdisrvctl [general_options] -op event -e event_name [-s source ] [-d data]
-e event_name | The name of the event to send. |
-s source | The name of the source invoking the event (default "tdisrvctl"). |
-d data | The data to be passed to an event listener (default is null). |
Example:
To send an event "user.process.X.completed" from "admin".
tdisrvctl -h itditest -op event -e "process.X.completed" -s admin -d "Admin triggered event"
All events sent from tdisrvctl using the -e option are prefixed by "user."
The usage for the prop operation is:
tdisrvctl [general_options] -op prop -c config_name
[ [-l ] |
[-o property_store]
[-g key | all] |
[-s key=value] [-e] |
[-d key] ]
where:
-c config_name | Name the config to work with. |
-l | List all the property stores configured. |
-o property_store | Name the property store to work with. |
-g key | Get the value of the specified key (or keyword ‘all' implying get all keys). |
-s key=value | Set the "key" to the specified "value." |
-e | Encrypt the value when putting in the store (can be used with -s option only). |
-d key | Delete the specified "key" from the store. |
Notes:
tdisrvctl -op report -l
Examples:
To see a list of all the property stores for config C1.xml
tdisrvctl -op prop -c C1.xml -l
To get a list of all the properties for config C1.xml
tdisrvctl -op prop -c C1.xml -g all
To get a list of all the properties for config C1.xml from store MyStore
tdisrvctl -op prop -c C1.xml -o MyStore -g all
To set a property MY_PROP to value MY_VALUE for config C1.xml in store MyStore and mark it as protected:
tdisrvctl -op prop -c C1.xml -o MyStore -s MY_PROP=MY_VALUE -e
This option is useful in a scripting environment. A TDI solution developer can develop a script to automatically query for exposed operations and then use the result to start an AssemblyLine with a specific operation using the start operation's -r -alop flag. The output of this operation is such that it can be grepped for or tokenized easily in a scripted environment.
The usage for the queryop operation is:
tdisrvctl [general_options] -op queryop -c <configFile> -r <ALname>
configFile | Config file name |
ALName | Name of the AssemblyLine |
Output:
ALOp:{attr_1;attr_2...attr_n;}
While specifying the "-c" option specify the COMPLETE configuration file path on the remote server, or give a path relative to the "configs" folder. To see the relative paths use the "report" option of tdisrvctl:
tdisrvctl -op report -l
Examples:
To query for operations exposed in an AL:
tdisrvctl -h itditest -T trust.kdb -W secret -op queryop -c examples/ADCustomConnector.xml -r ADAssemblyLine
Example Output:
$initialize: {ldapurl;loginPasswd;loginUserName}
The usage for reload operation is:
tdisrvctl [general_options] -op reload -c [config_list]
config_list | Comma separated list of Configs to reload. |
While specifying the "-c" option specify the COMPLETE configuration file path on the remote server, or give a path relative to the "configs" folder. To see the relative paths use the "report" option of tdisrvctl:
tdisrvctl -op report -l
Example:
To reload Configs C1.xml, C2.xml and C3.xml on remote host itditest:
tdisrvctl -h itditest -T trust.jks -W secret -op reload -c C1.xml,C2.xml,C3.xml
The config report lists details of the particular config. The details are AssemblyLines, Connectors and Parsers in each AssemblyLine, Connector library, Parser library, Script library, Function Library. This option gives a one shot view of all the details of a particular config.
The config listing option helps the user in finding out the list of configs available on the remote server and what their exact names are. Of course, only those configs can be seen that are in the "config" folder of the remote server (see global.properties file for property api.config.folder). This command cannot obtain list of configs located "anywhere" on the system.
The usage for the report operation is:
tdisrvctl [general_options] -op report [-c config | -l]
-c config | Name of the Config whose report is to be generated. |
-l | The Configs in the remote server's config folder. |
The displayed details for each connector or function component part of an AssemblyLine look like this:
Name : count Mode : Iterator State : Enabled Debug : Disabled Template : system:/Connectors/ibmdi.Timer Parser : [parent] Comment : None
Notes:
Examples:
To get a complete listing of the details of C1.xml on remote server:
tdisrvctl -h remoteserver -op report -c C1.xml
To get a list of the configs available in the "config" folder of the remote server:
tdisrvctl -h remoteserver -op report -l
The format for this command is:
tdisrvctl [general_options] -op shutdown [-o return_code] [-f]
-o return_code | The return code with which the remote TDI server should exit. |
-f | Force a controlled shutdown and exit all AssemblyLines. |
Examples:
To shutdown the local TDI server:
tdisrvctl -op shutdown
To shutdown the local TDI server, with a controlled shutdown of all AssemblyLines:
tdisrvctl -op shutdown -f
To shutdown the server running on remote host itditest which is configured for SSL (server-auth only)
tdisrvctl -h itditest -T trust.kdb -W secret -op shutdown
The usage of the command is:
tdisrvctl [general_options] -op srvinfo
Example:
To view the server information for a TDI server running on localhost
tdisrvctl -h localhost -op srvInfo
The usage for status operation is:
tdisrvctl [general_options] -op status -c [config_list | all]
-r [AL_list | all]
-listen
config_list | Comma-separated list of Configs or keyword "all". |
AL_list | Comma-separated list of ALs or keyword "all". |
-listen | indicates to start receiving the logs of a running Config or AssemblyLine. |
Notes:
tdisrvctl -op report -l
Examples:
To see the status of all configs and ALs:
tdisrvctl [general_options] -op status -c all -r all
We can also write
tdisrvctl [general_options] -op status
To see the status of AL1, AL2:
tdisrvctl -h itditest -op status -c c1.xml -r AL1,AL2
Output:
(Component Type # Component Name # RUNNING / STOPPED # Statistics):
1 # AL1 # RUNNING # [get:571] [add:571] [del:3] [requests:2333]....
1 # AL2 # STOPPED #
The Component Types are:
The Statistics contain the following details (valid for AssemblyLines only):
To see the details of Configs (running and stopped) on a particular server:
tdisrvctl -h itditest -op status -c all
To see the details of a running AssemblyLine on a particular server and start receiving its logs:
tdisrvctl -h itditest -op status -c rs.xml -r al1 -listen
The usage for the start operation is:
tdisrvctl [general_options] -op start -c [config]
-e [password]
-r [AL_list | all] -alop <alop_Name> [{requiredAttr_1; requiredAttr_2; ...
requiredAttr_n}] | [-f filename]
-s [Simulate mode]
-m [run name] -o [propStore1=filename1,propStore2=filename2...]
-t [temp config instance]
-listen
-sync
-c config | Name of config to start. |
-e password | Password of config file if it is encrypted. |
-r AL_list | Comma-separated list of ALs to start or keyword 'all'. |
-o property file list | comma separated list of property store names and values |
-alop operName | The specific AssemblyLine operation and list of list required attributes for the specified operation. |
-f filename | Name of the file where the input attributes and their values are configured for the operation. |
-s Simulate mode | Run the specified AssemblyLines in simulate mode |
-m multi-instance | Run multiple instances of same Config with different run names |
-t temp config instance | Start temp config instance from the XML in the config file specified |
-listen | receive the logs of the specified Config or AssemblyLine |
-sync | execute AssemblyLine synchronously |
Notes:
Examples:
tdisrvctl -h itditest -T trust.kdb -W secret -op start -c C1.xml -r AL1,Al2The -r option requires that -c option should also be specified. This is because the AssemblyLines mentioned in the command must belong to one of the Configs in the -c option.
tdisrvctl -h itditest -T trust.kdb -W secret -op start -c examples/ADCustomConnector.xml -r ADAssemblyLine -alop $initialize {ldapurl##ldap://9.182.190.149:390;loginPasswd##password;loginUsrname##cn=root}
tdisrvctl -h itditest -T trust.kdb -W secret -op start -c examples/ADCustomConnector.xml -r ADAssemblyLine -alop search {$init.ldapurl##ldap://9.182.190.149:390;$init.loginPasswd##password;$init.loginUsrname##cn=root;searchBase##o=ibm,c=us}
All initialization attributes are to be prefixed with $init.
tdisrvctl -h itditest -T trust.kdb -W secret -op start -c examples/ADCustomConnector.xml -r ADAssemblyLine -alop search -f inputFile
Input file format:
============
Key1:value1
Key2:value2
tdisrvctl -h itditest -T trust.kdb -W secret -op start -c examples/ADCustomConnector.xml -r AL1 -s
tdisrvctl -op start -c C1.xml -m test -f PropertyStorename=TestProp.properties, PropStore2=propfile2 ... -r AL1,AL2
tdisrvctl -op start -c C1.xml -t -r AL1
tdisrvctl -h itditest -op start -c rs.xml -listen
tdisrvctl -h itditest -op start -c rs.xml -r AL1 -listen
tdisrvctl -h itditest -op start -c rs.xml -r AL1 -sync
tdisrvctl [general_options] -op stop -c [config]
-r [AL_list | all]
where:
-c config | Name of Config. |
-r AL_list | Comma-separated list of ALs to stop or keyword "all." |
-f | Force a controlled shutdown of AssemblyLines. |
Notes:
tdisrvctl -op report -l
Example:
To stop assembly line AL1 and AL2, of Config C1 on remote server itditest:
tdisrvctl -h itditest -T trust.jks -W secret -op stop -c C1.xml -r AL1,Al2
The usage for the tombstone operation is:
tdisrvctl [general_options] -op tombstone -c [config]
[-r [AL_name] ]
[-age n]
[[attribute_list] | all ]
-age n | Tombstone record for the last 'n' days (default is 1 day). |
-c config | Name of Config. |
-r AL_name | Name of AssemblyLine. |
all | Tombstone attributes: show all. |
-ct | Component type. |
-cn | Component name. |
-guid | Tombstone entry's guid |
-et | Event type. |
-ex | Exit code. |
-stime | Component's start time. |
-ctime | Tombstone create time. |
-desc | Error description. |
-um | User message. |
-stat | Statistics (valid for ALs only). |
Notes:
tdisrvctl -op report -l
Examples:
tdisrvctl [general_options] -op tombstone -c C1.xml -age 2 all
tdisrvctl -h itdiserver -op tombstone -c C1 -age 3 all
tdisrvctl -h itdiserver -op tombstone -c C1 -ct -ctime -cn -um
tdisrvctl -h itdiserver -op tombstone -c C1 -r AL1
The usage for the delete tombstone operation is:
tdisrvctl [general_options] -op deletetombstone -guid <GUID number>
where
-guid "GUID number" is the unique identifier for the tombstone to be deleted. The GUID for a tombstone can be obtained by viewing the contents of the tombstone; see the entry about the tombstone option for details as to how to obtain the GUID.
The usage for the debug operation is as follows:
tdisrvctl [general_options] -op debug -c config
-r assembly_line
[-alc al_component]
-on/off
-c config | Name of Config. |
-r assembly_line | Name of AssemblyLine. |
-alc al_component | name of the AssemblyLine component. |
-on | flag to enable debug. |
-off | flag to disable debug. |
Notes:
tdisrvctl -op report -l
Examples:
tdisrvctl -op report -c C1
tdisrvctl -op debug -c C1-r al2 -on C1-r al2 -on
tdisrvctl -op debug -c C1-r al3 -alc comp1,comp2 -off