3.3.7. Use Operations and Commands in the Management CLI
Prerequisites
Procedure 3.13. Task
Construct the operation request
Operation requests allow for low-level interaction with the management model. They provide a controlled way to edit server configurations. An operation request consists of three parts:- an address, prefixed with a slash (
/). - an operation name, prefixed with a colon (
:). - an optional set of parameters, contained within parentheses (
()).
Determine the address
The configuration is presented as a hierarchical tree of addressable resources. Each resource node offers a different set of operations. The address specifies which resource node to perform the operation on. An address uses the following syntax:/node-type=node-name
- node-type is the resource node type. This maps to an element name in the configuration XML.
- node-name is the resource node name. This maps to the
nameattribute of the element in the configuration XML. - Separate each level of the resource tree with a slash (
/).
Refer to the configuration XML files to determine the required address. TheEAP_HOME/standalone/configuration/standalone.xmlfile holds the configuration for a standalone server and theEAP_HOME/domain/configuration/domain.xmlandEAP_HOME/domain/configuration/host.xmlfiles hold the configuration for a managed domain.Example 3.1. Example operation addresses
To perform an operation on the logging subsystem, use the following address in an operation request:/subsystem=logging
To perform an operation on the Java datasource, use the following address in an operation request:/subsystem=datasources/data-source=java
Determine the operation
Operations differ for each different type of resource node. An operation uses the following syntax::operation-name
- operation-name is the name of the operation to request.
Use theread-operation-namesoperation on any resource address in a standalone server to list the available operations.Example 3.2. Available operations
To list all available operations for the logging subsystem, enter the following request for a standalone server:[standalone@localhost:9999 /] /subsystem=logging:read-operation-names { "outcome" => "success", "result" => [ "add", "read-attribute", "read-children-names", "read-children-resources", "read-children-types", "read-operation-description", "read-operation-names", "read-resource", "read-resource-description", "remove", "undefine-attribute", "whoami", "write-attribute" ] }Determine any parameters
Each operation may require different parameters.Parameters use the following syntax:(parameter-name=parameter-value)
- parameter-name is the name of the parameter.
- parameter-value is the value of the parameter.
- Multiple parameters are separated by commas (
,).
To determine any required parameters, perform theread-children-typescommand on a resource node, passing the operation name as a parameter. Refer to Example 3.3, “Determine operation parameters” for details.Example 3.3. Determine operation parameters
To determine any required parameters for theread-children-typesoperation on the logging subsystem, enter theread-operation-descriptioncommand as follows:[standalone@localhost:9999 /] /subsystem=logging:read-operation-description(name=read-children-types) { "outcome" => "success", "result" => { "operation-name" => "read-children-types", "description" => "Gets the type names of all the children under the selected resource", "reply-properties" => { "type" => LIST, "description" => "The children types", "value-type" => STRING }, "read-only" => false } }
Enter the full operation request
Once the address, operation, and any parameters have been determined, enter the full operation request.Example 3.4. Example operation request
[standalone@localhost:9999 /]
/subsystem=web/connector=http:read-resource(recursive=true)
The management interface performs the operation request on the server configuration.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.