Command-file mode
The CLI offers the following command-file modes:
- Non-transactional command-file mode
- The CLI reads the command file and executes, sequentially, the
commands it contains. For each command, the CLI sends a request message
and waits for the response message. If the CLI does not receive a
response message, or the response message contains a completion code
that indicates an error, the CLI stops processing, but previously
executed commands are not rolled back. To specify that non-transactional command-file mode is to be used, use the -cf parameter to specify the name of the command file. For example, to process the command file CMDFILE3.CLI in non-transactional command-file mode, enter:
dnicli -i INST1 -ou BANKA -s SERVICENAME -cf CMDFILE3.CLI -cp IBM-1047 - Transactional command-file mode
- The CLI sends the commands contained in the command file to a
service, which processes them all in a single transaction. If, during
processing, the service is unable to processes any of the commands,
it rolls back the others, so that either all or none of the commands
are processed. Only the following services can be used in transactional
command-file mode:
- System configuration service (DNI_SYSADM)
- Security administration service (DNI_SECADM)
To specify that transactional command-file mode is to be used, use the -cft parameter to specify the name of the command file. For example, to process the command file CMDFILE3.CLI in transactional command-file mode, enter:dnicli -i INST1 -ou BANKA -s SERVICENAME -cft CMDFILE3.CLI -cp IBM-1047
The CLI writes the output of the executed commands to the standard
output. When the commands in a command file are executed automatically,
for example as a UNIX cron job,
redirect the output of the CLI program. For example, the command file
displayer.cli contains the commands to create the Displayer role and
add the necessary COs and their attribute values. When you run displayer.cli
in the security administration service, you create a Displayer role
that can display all configuration entities and security entities.
It is assumed that dual authorization is disabled, so you can also
approve the role and put it into production using this script. You
must have the appropriate access rights in the security administration
service to run this command file. The command file displayer.cli contains:
; This command file creates a role and adds attributes to it.
cre -ro Displayer -desc "List all FTM SWIFT entities"
add -ro Displayer -ct DniSecAdm.list -co DniSecAdm.list -attr ro
add -ro Displayer -ct DniSecAdm.list -co DniSecAdm.list -attr user
add -ro Displayer -ct DniSysAdm.list -co DniSysAdm.list -attr cos
add -ro Displayer -ct DniSysAdm.list -co DniSysAdm.list -attr ct
add -ro Displayer -ct DniSysAdm.list -co DniSysAdm.list -attr ou
com -ro Displayer
app -ro DisplayerNotes:
- Configuration files must use code page 1047. When they are edited, they must be edited using this code page.
- When executing commands in the command-file mode, configuration changes do not become active immediately after they are deployed. The delay depends on the setting of the polling interval, which is described in Providing configuration data to services.
- All lines that begin with a semicolon (;) character are regarded by the CLI as comment. Use the semicolon (;) character to add comments to a command file, or to deactivate commands that you might want to reactivate later.