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
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With