• No results found

Management CLI Operations

Example configurations

Procedure 3.11. Task 1. Run the help command

2. Enter the full operation request

3.4. Management CLI Operations

3.4 .1. Display the Attributes of a Resource with the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Summary

The read-attribute operation is a global operation used to read the current runtime value of a selected attribute. It can be used to expose only the values that have been set by the user, ignoring any default or undefined values. The request properties include the following parameters.

Request Properties nam e

The name of the attribute to get the value for under the selected resource.

include-defaults

A Boolean parameter that can be set to false to restrict the operation results to only show attributes set by the user and ignore default values.

Procedure 3.14 . Task

Run the read-attribute operation

From the Management CLI, use the read-attribute operation to display the value of a resource attribute. 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-attribute(name=name-of-attribute)

An advantage of the read-attribute operation is the ability to expose the current runtime value of a specific attribute. Similar results can be achieved with the read-resource operation, but only with the addition of the include-runtime request property, and only as part of a list of all available resources for that node. The read-attribute operation is intended for fine-grained attribute queries, as the following example shows.

Example 3.5. Run the read-attribute operation to expose the public interface IP If you know the name of the attribute that you would like to expose, you can use the read-attribute to return the exact value in the current runtime.

[standalone@localhost:9999 /] /interface=public:read-attribute(name=resolved-address)

{

"outcome" => "success", "result" => "127.0.0.1"

}

The resolved-address attribute is a runtime value, so it is not displayed in the results of the standard read-resource operation.

[standalone@localhost:9999 /] /interface=public:read-resource {

"outcome" => "success", "result" => {

"any" => undefined,

"any-address" => undefined, "any-ipv4-address" => undefined, "any-ipv6-address" => undefined,

"inet-address" => expression "${jboss.bind.address:127.0.0.1}", "link-local-address" => undefined,

To display resolved-address and other runtime values, you must use the include-runtime request property.

[standalone@localhost:9999 /] /interface=public:read-resource(include-runtime=true)

{

"outcome" => "success", "result" => {

"any" => undefined,

"any-address" => undefined, "any-ipv4-address" => undefined, "any-ipv6-address" => undefined,

"inet-address" => expression "${jboss.bind.address:127.0.0.1}", "link-local-address" => undefined,

Result

The current runtime attribute value is displayed.

Report a bug

3.4 .2. Display the Active User in the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Summary

The whoami operation is a global operation used to identify the attributes of the current active user.

The operation exposes the identity of the username and the realm that they are assigned to. The whoam i operation is useful for administrators managing multiple users accounts across multiple realms, or to assist in keeping track of active users across domain instances with multiple terminal session and users accounts.

Procedure 3.15. Task

Run the whoami operation

From the Management CLI, use the whoami operation to display the active user account.

[standalone@localhost:9999 /] :whoami

The following example uses the whoami operation in a standalone server instance to show that the active user is username, and that the user is assigned to the ManagementRealm realm.

Example 3.6. Use the whoami in a standalone instance

[standalone@localhost:9999 /]:whoami {

"outcome" => "success", "result" => {"identity" => { "username" => "username", "realm" => "ManagementRealm"

}}

}

Result

Your current active user account is displayed.

Report a bug

3.4 .3. Display System and Server Information in the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Procedure 3.16. Task

Run the version command

From the Management CLI, enter the version command:

[domain@localhost:9999 /] version

Result

Your application server version and environment information is displayed.

Report a bug

3.4 .4 . Display an Operation Description using the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Procedure 3.17. Task

Run the read-operation-description operation

From the Management CLI, use read-operation-description to display information about the operation. The operation requires additional parameters in the format of a key-value pair to indicate which operation to display. 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-operation-description(name=name-of-operation)

Example 3.7. Display the list-snapshots operation description

The following example shows the method for describing the list-snapshots operation.

[standalone@localhost:9999 /] :read-operation-description(name=list-snapshots) {

"outcome" => "success", "result" => {

"operation-name" => "list-snapshots", "description" => "Lists the snapshots", "reply-properties" => {

"type" => OBJECT, "value-type" => { "directory" => { "type" => STRING,

"description" => "The directory where the snapshots are stored"

},

"names" => { "type" => LIST,

"value-type" => STRING,

"description" => "The names of the snapshots within the snapshots directory"

} } },

"read-only" => false }

}

Result

The description is displayed for the chosen operation.

Report a bug

3.4 .5. Display the Operation Names using the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Procedure 3.18. Task

Run the read-operation-names operation

From the Management CLI, use the read-operation-names operation to display the names of the available operations. 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-operation-names

Example 3.8. Display the operation names using the Management CLI

The following example shows the method for describing the read-operation-names operation.

[standalone@localhost:9999 /]:read-operation-names {

"outcome" => "success", "result" => [

"read-operation-description", "read-operation-names", "read-resource",

"read-resource-description", "reload",

The available operation names are displayed.

Report a bug

3.4 .6. Display Available Resources using the Management CLI

Prerequisites

Section 3.3.2, “Launch the Management CLI”

Summary

The read-resource operation is a global operation used to read resource values. It can be used to expose either basic or complete information about the resources of the current or child nodes, along with a range of request properties to expand or limit the scope of the operation results. The request

properties include the following parameters.

Request Properties recursive

Whether to recursively include complete information about child resources.

recursive-depth

The depth to which information about child resources should be included.

proxies

Whether to include remote resources in a recursive query. For example including the host level resources from slave Host Controllers in a query of the Domain Controller.

include-runtim e

Whether to include runtime attributes in the response, such as attribute values that do not come from the persistent configuration. This request property is set to false by default.

include-defaults

A boolean request property that serves to enable or disable the reading of default attributes.

When set to false only the attributes set by the user are returned, ignoring any that remain undefined.

Procedure 3.19. Task