7

Using JBoss 7's jboss-cli I can query the 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

Programatically I can query any CLI query starting with /, for example this:

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

where the address is

/path=jboss.server.log.dir

and the operation is

read-attribute(name=path)

My question is, for the CLI query

deployment-info --headers=

what is the address and what is the operation?

Best regards, SK

Kilátó
  • 403
  • 3
  • 10
  • 19

4 Answers4

15

I've found this solution useful for querying the deployed applications in standalone mode by using CLI api.

The CLI query is:

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

where the address "/deployment=*" will target all the deployments. And basically requests the name attribute for all deployments in current server.

Finally this snippet shows the code for executing the query by using the model controller api:

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

Walter Medvedeo
  • 151
  • 1
  • 4
2

Did you try this command?

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

You can navigate the model nodes and get the details you needed.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
akumaras
  • 55
  • 1
  • 11
0

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

The --help option shows you the online help for deployment-info:

[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's 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.
...
TecMat
  • 11
0

Enter:

deployment-info --name=  

and then press tab. It will autocomplete all deployments.

Marcin
  • 1,429
  • 8
  • 16