JBoss 7 CLI to request all deployed applications

Using JBoss 7 jboss-cli I can request deployed applications:

[standalone@localhost:9999 /] deployment-info --headers=
NAME                 RUNTIME-NAME         PERSISTENT ENABLED STATUS
jboss-ejb-in-ear.ear jboss-ejb-in-ear.ear true       true    OK
singleton_in_war.war singleton_in_war.war true       true    OK

Programmatically, I can query any CLI request starting with /, for example:

/path=jboss.server.log.dir:read-attribute(name=path)

where is the address

/path=jboss.server.log.dir

and operation

read-attribute(name=path)

My question is: for CLI request

deployment-info --headers=

what is the address and what is the operation?

Regards, SK

+3
source share
4 answers

I found this solution useful for querying deployed applications offline using the CLI api.

CLI Request:

/deployment=*:read-attribute(name=name)

where the address "/ deployment = *" will target all deployments. And basically it asks for a name attribute for all deployments on the current server.

Finally, this code snippet shows how to execute a request using the api model controller:

ModelControllerClient client = "...create the controller client";

ModelNode operation = new ModelNode( );
operation.get( "address" ).add( "deployment", "*" );
operation.get( "operation" ).set( "read-attribute" );
operation.get( "name" ).set( "name" );

ModelNode result = client.execute( operation );

List<ModelNode> deployments = result.get( "result" ).asList();
String deploymentName;

// finally we can iterate and get the deployment names.
for ( ModelNode deployment : deployments ) {
    deploymentName = deployment.get( "result" ).asString();
    System.out.println( "deploymentName = " + deploymentName );
}

Works for both WF10 and EAP7

+4

?

/server-group=*/deployment=*/:read-resource(recursive=false,proxies=true,include-runtime=true,include-defaults=true)

.

+1

The deployment information command has only the --name and -headers options. Using the command deployment-info --name=singleton_in_war.war, you can narrow the information down to this deployment only.

The --help parameter displays online help for deployment information:

[standalone@localhost:9999 /] deployment-info --help
SYNOPSIS

Standalone mode:

deployment-info [--name=wildcard_expression]
                [--headers={operation_header (;operation_header)*}]

Domain mode:

deployment-info --name=deployment_name |
                --server-group=server_group [--name=wildcard_expression]
                [--headers={operation_header (;operation_header)*}]

DESCRIPTION


Displays information about single or multiple deployments.

In the standalone mode the --name argument is optional.
If it absent, the command will display information about all the
registered deployments. Otherwise, the value of the --name is either a
specific deployment name or a wildcard expression.
...
-1
source

Enter:

deployment-info --name=  

and then click the tab. It will automatically complete the deployment.

-1
source

All Articles