JBoss 7 CLI用于查询所有已部署的应用程序

Kil*_*átó 5 jboss command-line-interface

使用JBoss 7的jboss-cli我可以查询已部署的应用程序:

[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
Run Code Online (Sandbox Code Playgroud)

以编程方式,我可以查询以/开头的任何CLI查询,例如:

/path=jboss.server.log.dir:read-attribute(name=path)
Run Code Online (Sandbox Code Playgroud)

地址在哪里

/path=jboss.server.log.dir
Run Code Online (Sandbox Code Playgroud)

而且操作是

read-attribute(name=path)
Run Code Online (Sandbox Code Playgroud)

我的问题是,对于CLI查询

deployment-info --headers=
Run Code Online (Sandbox Code Playgroud)

地址是什么,操作是什么?

最好的问候,SK

小智 9

我发现这个解决方案对于使用CLI api以独立模式查询已部署的应用程序非常有用.

CLI查询是:

/deployment=*:read-attribute(name=name)
Run Code Online (Sandbox Code Playgroud)

其中地址"/ deployment =*"将针对所有部署.并且基本上为当前服务器中的所有部署请求name属性.

最后,该片段显示了使用模型控制器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 );
}
Run Code Online (Sandbox Code Playgroud)

适用于WF10和EAP7


小智 0

部署信息命令只有选项 --name 和 --headers。使用该命令,deployment-info --name=singleton_in_war.war您可以将信息范围缩小到仅此部署。

--help 选项显示部署信息的在线帮助:

[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.
...
Run Code Online (Sandbox Code Playgroud)