Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 10. Common Actions with JBoss ON CLI Scripts
IMPORTANT
The remote API cannot be run from a client inside an application server. For example, the remote API cannot be run from a client inside an EAP instance; it fails with errors like the following:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
10.1. Logging In Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
The CLI actually connects to the JBoss ON server, much like connecting through the GUI. This means that you have to log into the server before you can perform most tasks.
There are two ways to log into the server through the CLI:
- By passing user credentials when the rhq-cli.sh script is run.
- By using the command in a script or after starting the CLI without connecting to the server.
When logging into the server, other connection information, such as a server name and port number, can be passed with the login command.
Example 10.1. Logging in to a Specified Server
This connects to the CLI and logs into the JBoss ON server on 192.168.1.100 over port 70443. Because the port number ends with 443, the CLI automatically attempts to connect over SSL.
rhq-cli.sh -u rhqadmin -p rhqadmin -s 192.168.1.100 -t 70443
rhq-cli.sh -u rhqadmin -p rhqadmin -s 192.168.1.100 -t 70443
Example 10.2. Prompting for a Password
Instead of sending the password in clear text, it is possible to have the server prompt for a password. This is probably unnecessary when connecting to a server on the local host, but it is useful if the target JBoss ON server is on a different system.
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhq-cli.sh -u rhqadmin -P
rhq-cli.sh -u rhqadmin -P