Example configurations
Procedure 3.11. Task 1. Run the help command
1. Run the read-resource-description operation
"outcome" => "success", "result" => {
3.4 .7. Display Available Resource Descriptions using the Management CLI
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.20. Task
1. Run the read-resource-description operation
From the Management CLI, use the read-resource-description operation to read and display the available resources. For more details on operation requests, refer to the topic Section 3.3.7, “Use Operations and Commands in the Management CLI”.
[standalone@localhost:9999 /]:read-resource-description 2. Use optional parameters
The read-resource-description operation allows the use of the additional parameters.
a. Use the operations parameter to include descriptions of the resource's operations.
[standalone@localhost:9999 /]:read-resource-description(operations=true)
b. Use the inherited parameter to include or exclude descriptions of the resource's inherited operations. The default state is true.
[standalone@localhost:9999 /]:read-resource-description(inherited=false)
c. Use the recursive parameter to include recursive descriptions of the child resources.
[standalone@localhost:9999 /]:read-resource-description(recursive=true)
d. Use the locale parameter to get the resource description in. If null, the default locale will
be used.
[standalone@localhost:9999 /]:read-resource-description(locale=true)
Result
Descriptions of the available resources are displayed.
Report a bug
3.4 .8. Reload the Application Server using the Management CLI
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.21. Task
Run the reload operation
From the Management CLI, use the reload operation to shut the server down via the System .exit(0) system call. For more details on operation requests, refer to the topic Section 3.3.7, “Use Operations and Commands in the Management CLI”.
[standalone@localhost:9999 /]:reload {"outcome" => "success"}
Result
The application server reloads by shutting down all services and starting the runtime again. The Management CLI automatically reconnects.
Report a bug
3.4 .9. Shut the Application Server down using the Management CLI
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.22. Task
Run the shutdown operation
From the Management CLI, use the shutdown operation to shut the server down via the System .exit(0) system call. For more details on operation requests, refer to the topic Section 3.3.7, “Use Operations and Commands in the Management CLI”.
[standalone@localhost:9999 /]:shutdown
Result
The application server is shut down. The Management CLI will be disconnected as the runtime is unavailable.
Report a bug
3.4 .10. Configure an Attribute with the Management CLI
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Summary
The write-attribute operation is a global operation used to write or modify a selected resource attribute. You can use the operation to make persistent changes and to modify the configuration settings of your managed server instances. The request properties include the following parameters.
Request Properties nam e
The name of the attribute to set the value for under the selected resource.
value
The desired value of the attribute under the selected resource. May be null if the underlying model supports null values.
Procedure 3.23. Task
Run the write-attribute operation
From the Management CLI, use the write-attribute operation to modify the value of a resource attribute. The operation can be run at the child node of the resource or at the root node of the Management CLI where the full resource path is specified.
Example 3.13. Disable the deployment scanner with the write-attribute operation The following example uses the write-attribute operation to disable the deployment scanner.
The operation is run from the root node, using tab completion to aid in populating the correct resource path.
[standalone@localhost:9999 /]
/subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled,value=false) {"outcome" => "success"}
The results of the operation can be confirmed directly with the read-attribute operation.
[standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:read-attribute(name=scan-enabled)
{
"outcome" => "success", "result" => false }
The results can also be confirmed by listing all of the node's available resource attributes with the read-resource operation. In the following example, this particular configuration shows the scan-enabled attribute is now set to false.
[standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:read-resource
{
"outcome" => "success", "result" => {
"auto-deploy-exploded" => false, "auto-deploy-xml" => true, "auto-deploy-zipped" => true, "deployment-timeout" => 600, "path" => "deployments",
"relative-to" => "jboss.server.base.dir", "scan-enabled" => false,
"scan-interval" => 5000 }
}
Result
The resource attribute is updated.
Report a bug
3.5. The Management CLI Command History
3.5.1. Use the Management CLI Command History
The Management CLI features a command history functionality that is enabled by default in the application server installation. The history is kept both as a record in the volatile memory of the active CLI session, and appended to a log file that saves automatically in the user's home directory as .jboss-cli-history. This history file is configured by default to record up to a maximum of 500 CLI commands.
The history command by itself will return the history of the current session, or with additional arguments will disable, enable or clear the history from the session memory. The Management CLI also features the ability to use your keyboard's arrow keys to go back and forth in the history of commands and operations.
Functions of the Management CLI history
Section 3.5.2, “Show the Management CLI Command history”
Section 3.5.3, “Clear the Management CLI Command history”
Section 3.5.4, “Disable the Management CLI Command history”
Section 3.5.5, “Enable the Management CLI Command history”
Report a bug
3.5.2. Show the Management CLI Command history
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.24 . Task
Run the history command
From the Management CLI, enter the history command:
[standalone@localhost:9999 /] history
Result
The CLI command history stored in memory since the CLI startup or the history clear command is displayed.
Report a bug
3.5.3. Clear the Management CLI Command history
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.25. Task
Run the history --clear command
From the Management CLI, enter the history --clear command:
[standalone@localhost:9999 /] history --clear
Result
The history of commands recorded since the CLI startup is cleared from the session memory. The command history is still present in the .jboss-cli-history file saved to the user's home directory.
Report a bug
3.5.4 . Disable the Management CLI Command history
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.26. Task
Run the history --disable command
From the Management CLI, enter the history --disable command:
[standalone@localhost:9999 /] history --disable
Result
Commands made in the CLI will not be recorded either in memory or in the .jboss-cli-history file saved to the user's home directory.
Report a bug
3.5.5. Enable the Management CLI Command history
Prerequisites
Section 3.3.2, “Launch the Management CLI”
Procedure 3.27. Task
Run the history --enable command
From the Management CLI, enter the history --enable command:
[standalone@localhost:9999 /] history --enable
Result
Commands made in the CLI are recorded in memory and in the .jboss-cli-history file saved to the user's home directory.
Report a bug