All the commands that may be executed from the grid shell may also be executed from a remote client through ssh.
In all syntax examples, controllerhost is the hostname of the grid controller being accessed. It is assumed that the client has set up an SSH agent to provide the necessary identity keys for access authorization or that a valid access key is otherwise provided to the SSH utility, For example, through a command line option or a configuration file. Regardless of the method used for supplying the access options, the client may only use an SSH2 private key, such as RSA or DSA, and must request access to the controller as 'root'. The corresponding public key must have been installed on the controller using the Web interface or by another user that has shell access to the controller.
If you are using GNU bash as your shell, a set of shell functions is available for conveniently accessing the CLI commands from your shell, either interactively or in a script. See Client-side Macros.
ssh root@controllerhost entity command [args]
execute a single 3t shell command (command) on the controller
ssh root@controllerhost command entity [args]
same as above, with command and entity name swapped. Both syntax variants are accepted by the 3t shell
Notes:
ssh root@controllerhost 3t entity command [args] ssh root@controllerhost 3t command entity [args]
ssh root@controllerhost app config myapp .description=\'Some description with spaces in it\'
Following are remote commands intended for advanced scripts and for implementing interactive shell interfaces that have client-side code. See ClientSideMacros for an example of such an interface, implemented for the GNU bash shell.
ssh [-t] controllerhost sh [args]
This command has the same function as the ssh command in the CLI interface, but is intended only for direct invocation as shown above and cannot be accessed through the interactive CA AppLogic shell prompt. It provides automatic setup of pseudo-terminal on the target appliance, to allow transparent use of interactive commands that require a tty (for example, the 'vi' editor).
ssh controllerhost =appname command [args]
This is a variation of the normal non-interactive command invocation described above, which provides a "current application" for the CA AppLogic CLI command. It is equivalent to executing the following two commands from the interactive shell:
ca appname command [args]
Although each individual CLI command that supports 'current application' also allows an explicit application name to be specified, this alternative way of providing an application name is useful for client scripts that have their own notion of a 'current application' and also use a common function to invoke the remote CA AppLogic commands. This way, the function that does the actual remote command invocation does not need to know the command syntax and whether the particular command takes an application as an argument at all - it simply puts the current application name as the first word in the command and lets the CA AppLogic remote shell apply its own rules for using 'current application'.
Here's a simple example (GNU bash), which defines a function named '3t', to be used for invoking remote commands:
function 3t() { ssh $CONTROLLER =$APP "$@" ; }
With this function, one simply has to set their controller host and current application, and start using remote commands from the local shell by prefixing them with 3t for example:
CONTROLLER=ctl.3tera.net APP=TWiki 3t grid info 3t app list # in this command, the current app name doesn't matter 3t app start # here, the current application name will actually be used
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|