JBoss CLI doesn't return json format on EAP 7
Issue
While under normal runtime running the command:
./JBOSS_HOME/bin/jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
Returns json
as it should when the outcome of the command is success
:
./jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
{
"outcome" : "success",
"result" : [
{
"address" : [
{
"host" : "master"
},
{
"server" : "server-one"
},
{
"deployment" : "app.war"
}
],
However, when the outcome of the CLI
command is failed
, the --output-json
doesn't work, throwing a DMR
format as output.
./jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
{
"outcome" => "failed",
"result" => [{
"address" => [
("host" => "master"),
("server" => "server-two"),
("deployment" => "app.war")
],
"outcome" => "failed",
"result" => {
"content" => [{
"hash" => bytes {
0x73, 0xa2, 0x23, 0xaf, 0x5b, 0xb3, 0x3f, 0xc0,
0xaf, 0x84, 0x56, 0x33, 0x99, 0xfb, 0x6c, 0xa6,
0xd1, 0xf1, 0x58, 0x40
},
"archive" => undefined
(...)
"rolled-back" => true
Environment
- Red Hat JBoss Enterprise Application Platform
- 7.2.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.