HTTP API support for plain JBoss-CLI commands

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP API support for plain JBoss-CLI commands

Jairo Junior

I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:

:shutdown(restart=true)

becomes

{"operation" : "shutdown", "restart" : "true" }

Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...

[1] https://github.com/biemond/biemond-wildfly


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Heiko Braun

You can already use DMR over HTTP. It requires a different content-type ('application/dmr-encoded') and uses a base64 encoded representation of the payload ('ModelNode.toBase64String()').

You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’ for both 'Content-Type' and ‘Accept’ headers.

The response can be parse using 'ModelNode.fromBase64()'.

Hope this helps,
Heiko



> On 27 May 2015, at 19:54, Jairo Junior <[hidden email]> wrote:
>
> I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:
>
> :shutdown(restart=true)
>
> becomes
>
> {"operation" : "shutdown", "restart" : "true" }
>
> Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...
>
> [1] https://github.com/biemond/biemond-wildfly
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Heiko Braun
The DMR library can be found here:



On 28 May 2015, at 10:56, Heiko Braun <[hidden email]> wrote:


You can already use DMR over HTTP. It requires a different content-type ('application/dmr-encoded') and uses a base64 encoded representation of the payload ('ModelNode.toBase64String()').

You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’ for both 'Content-Type' and ‘Accept’ headers.

The response can be parse using 'ModelNode.fromBase64()'.

Hope this helps,
Heiko



On 27 May 2015, at 19:54, Jairo Junior <[hidden email]> wrote:

I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:

:shutdown(restart=true)

becomes

{"operation" : "shutdown", "restart" : "true" }

Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...

[1] https://github.com/biemond/biemond-wildfly

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Jairo Junior
Heiko,

Thank you, but how do I build a ModelNode from a CLI command?

Before using JSON I was investigating how Administration Console perform operations and I realized (using firebug) that it uses application/dmr, but I presumed it uses ModelNode to build commands, not plain CLI syntax.

On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]> wrote:
The DMR library can be found here:



On 28 May 2015, at 10:56, Heiko Braun <[hidden email]> wrote:


You can already use DMR over HTTP. It requires a different content-type ('application/dmr-encoded') and uses a base64 encoded representation of the payload ('ModelNode.toBase64String()').

You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’ for both 'Content-Type' and ‘Accept’ headers.

The response can be parse using 'ModelNode.fromBase64()'.

Hope this helps,
Heiko



On 27 May 2015, at 19:54, Jairo Junior <[hidden email]> wrote:

I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:

:shutdown(restart=true)

becomes

{"operation" : "shutdown", "restart" : "true" }

Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...

[1] https://github.com/biemond/biemond-wildfly

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

John Mazzitelli
FYI: This might be useful... Hawkular has a DMR client library built on top of the ModelNode/ModelControllerClient stuff - it is meant to be a more strongly typed library that helps you not have to know how to do all the low level ModelNode stuff to do basic things (though it still allows you to send custom ModelNode requests).

It's here:

https://github.com/hawkular/hawkular-agent/tree/master/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient

released here:

https://repository.jboss.org/nexus/content/groups/public/org/hawkular/agent/hawkular-dmr-client/

which includes javadoc/source jars.

Doesn't give you "everything", but it has the basics and then some for what we need it for. This lib will get built out as we need more functionality.

Example usage:

ModelControllerClient mcc; // get this somehow - usually by ModelControllerClient.Factory.create
CoreJBossASClient client = new CoreJBossASClient(mcc); // use one of the provided JBossASClient subclasses
String dataDir = client.getAppServerDataDir(); // gets the app server's data directory
ModelNode node = client.readResource(Address.parse("/deployment=foo.war")); // gets info on foo.war
...
DeploymentJBossASClient dClient = new DeploymentJBossASClient(mcc); // to do deployment specific things
dClient.enableDeployment("foo.war");
...

etc, etc... a bunch of subclasses to JBossASClient that lets you do specific things to things like datasources, logging, web connectors, etc.

----- Original Message -----

> Heiko,
>
> Thank you, but how do I build a ModelNode from a CLI command?
>
> Before using JSON I was investigating how Administration Console perform
> operations and I realized (using firebug) that it uses application/dmr, but
> I presumed it uses ModelNode to build commands, not plain CLI syntax.
>
> On Thu, May 28, 2015 at 5:58 AM Heiko Braun < [hidden email] > wrote:
>
>
>
> The DMR library can be found here:
>
> https://github.com/jbossas/jboss-dmr
>
>
>
>
>
> On 28 May 2015, at 10:56, Heiko Braun < [hidden email] > wrote:
>
>
> You can already use DMR over HTTP. It requires a different content-type
> ('application/dmr-encoded') and uses a base64 encoded representation of the
> payload ('ModelNode.toBase64String()').
>
> You can describe an operation through the DMR API and then simply do HTTP
> POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’
> for both 'Content-Type' and ‘Accept’ headers.
>
> The response can be parse using 'ModelNode.fromBase64()'.
>
> Hope this helps,
> Heiko
>
>
>
>
>
> On 27 May 2015, at 19:54, Jairo Junior < [hidden email] > wrote:
>
> I've been working on a Puppet Module for Wildfly [1] that uses his HTTP
> Management API to perform operations (manage resources/deploys and execute
> commands), but my command execution code is a little bit limited cause I
> have to transform from CLI syntax to JSON. e.g.:
>
> :shutdown(restart=true)
>
> becomes
>
> {"operation" : "shutdown", "restart" : "true" }
>
> Is there any specific reason to not support plain CLI commands through HTTP
> API? I looked at the code and it didn't see hard to implement this...
>
> [1] https://github.com/biemond/biemond-wildfly
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Heiko Braun
In reply to this post by Jairo Junior
What the constraints when developing a puppet module? Is plain java supported? 




Am 29.05.2015 um 01:39 schrieb Jairo Junior <[hidden email]>:

Heiko,

Thank you, but how do I build a ModelNode from a CLI command?

Before using JSON I was investigating how Administration Console perform operations and I realized (using firebug) that it uses application/dmr, but I presumed it uses ModelNode to build commands, not plain CLI syntax.

On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]> wrote:
The DMR library can be found here:



On 28 May 2015, at 10:56, Heiko Braun <[hidden email]> wrote:


You can already use DMR over HTTP. It requires a different content-type ('application/dmr-encoded') and uses a base64 encoded representation of the payload ('ModelNode.toBase64String()').

You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’ for both 'Content-Type' and ‘Accept’ headers.

The response can be parse using 'ModelNode.fromBase64()'.

Hope this helps,
Heiko



On 27 May 2015, at 19:54, Jairo Junior <[hidden email]> wrote:

I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:

:shutdown(restart=true)

becomes

{"operation" : "shutdown", "restart" : "true" }

Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...

[1] https://github.com/biemond/biemond-wildfly

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Jairo Junior
No, it's not. Only ruby. Although, I could use JRuby to import and use Java classes, it would give me more trouble than solutions.

What I want is: An interoperable way to talk with JBoss. application/dmr is a binary/proprietary format.

On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]> wrote:
What the constraints when developing a puppet module? Is plain java supported? 




Am 29.05.2015 um 01:39 schrieb Jairo Junior <[hidden email]>:

Heiko,

Thank you, but how do I build a ModelNode from a CLI command?

Before using JSON I was investigating how Administration Console perform operations and I realized (using firebug) that it uses application/dmr, but I presumed it uses ModelNode to build commands, not plain CLI syntax.

On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]> wrote:
The DMR library can be found here:



On 28 May 2015, at 10:56, Heiko Braun <[hidden email]> wrote:


You can already use DMR over HTTP. It requires a different content-type ('application/dmr-encoded') and uses a base64 encoded representation of the payload ('ModelNode.toBase64String()').

You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use 'application/dmr-encoded’ for both 'Content-Type' and ‘Accept’ headers.

The response can be parse using 'ModelNode.fromBase64()'.

Hope this helps,
Heiko



On 27 May 2015, at 19:54, Jairo Junior <[hidden email]> wrote:

I've been working on a Puppet Module for Wildfly [1] that uses his HTTP Management API to perform operations (manage resources/deploys and execute commands), but my command execution code is a little bit limited cause I have to transform from CLI syntax to JSON. e.g.:

:shutdown(restart=true)

becomes

{"operation" : "shutdown", "restart" : "true" }

Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn't see hard to implement this...

[1] https://github.com/biemond/biemond-wildfly

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Darran Lofthouse
It was written a couple of years back but this is a good blog post to
look at for different clients sending in management requests: -

http://pilhuhn.blogspot.co.uk/2012/01/polyglot-management-of-secured-as7.html

You don't need to go as far as the Base64 encoding and decoding if you
do not want to and just create the json formatted requests and parse the
json responses.

Regards,
Darran Lofthouse.

On 29/05/15 13:11, Jairo Junior wrote:

> No, it's not. Only ruby. Although, I could use JRuby to import and use
> Java classes, it would give me more trouble than solutions.
>
> What I want is: An interoperable way to talk with JBoss. application/dmr
> is a binary/proprietary format.
>
> On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     What the constraints when developing a puppet module? Is plain java
>     supported?
>
>
>
>
>     Am 29.05.2015 um 01:39 schrieb Jairo Junior <[hidden email]
>     <mailto:[hidden email]>>:
>
>>     Heiko,
>>
>>     Thank you, but how do I build a ModelNode from a CLI command?
>>
>>     Before using JSON I was investigating how Administration Console
>>     perform operations and I realized (using firebug) that it uses
>>     application/dmr, but I presumed it uses ModelNode to build
>>     commands, not plain CLI syntax.
>>
>>     On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]
>>     <mailto:[hidden email]>> wrote:
>>
>>         The DMR library can be found here:
>>
>>         https://github.com/jbossas/jboss-dmr
>>
>>
>>>         On 28 May 2015, at 10:56, Heiko Braun <[hidden email]
>>>         <mailto:[hidden email]>> wrote:
>>>
>>>
>>>         You can already use DMR over HTTP. It requires a different
>>>         content-type ('application/dmr-encoded') and uses a base64
>>>         encoded representation of the payload
>>>         ('ModelNode.toBase64String()').
>>>
>>>         You can describe an operation through the DMR API and then
>>>         simply do HTTP POST to ‘/management’ endpoint. make sure to
>>>         use 'application/dmr-encoded’ for both 'Content-Type' and
>>>         ‘Accept’ headers.
>>>
>>>         The response can be parse using 'ModelNode.fromBase64()'.
>>>
>>>         Hope this helps,
>>>         Heiko
>>>
>>>
>>>
>>>>         On 27 May 2015, at 19:54, Jairo Junior
>>>>         <[hidden email] <mailto:[hidden email]>>
>>>>         wrote:
>>>>
>>>>         I've been working on a Puppet Module for Wildfly [1] that
>>>>         uses his HTTP Management API to perform operations (manage
>>>>         resources/deploys and execute commands), but my command
>>>>         execution code is a little bit limited cause I have to
>>>>         transform from CLI syntax to JSON. e.g.:
>>>>
>>>>         :shutdown(restart=true)
>>>>
>>>>         becomes
>>>>
>>>>         {"operation" : "shutdown", "restart" : "true" }
>>>>
>>>>         Is there any specific reason to not support plain CLI
>>>>         commands through HTTP API? I looked at the code and it
>>>>         didn't see hard to implement this...
>>>>
>>>>         [1] https://github.com/biemond/biemond-wildfly
>>>>
>>>>         _______________________________________________
>>>>         wildfly-dev mailing list
>>>>         [hidden email] <mailto:[hidden email]>
>>>>         https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>>
>>
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Jairo Junior
Darran,

Thank you, wish I had found your blog post before. Fortunately, I was able to build almost the same thing with a lot of effort: https://github.com/biemond/biemond-wildfly/blob/master/lib/puppet_x/util/wildfly_cli.rb

My point is: Sysadmins often build CLI scripts to automate tasks and I want to "reuse" this knowledge in HTTP API. Sysadmins don't talk JSON, they talk CLI...

I heard somewhere that jboss-cli.sh and Management Console are using the same HTTP API in Wildfly, but I'm not sure how jboss-cli.sh use this commands...

In fact, I tried to use jboss-cli.sh but bash is incredible slow compared to HTTP API: https://github.com/cpitman/puppet-jboss_admin/issues/68

On Fri, May 29, 2015 at 9:22 AM Darran Lofthouse <[hidden email]> wrote:
It was written a couple of years back but this is a good blog post to
look at for different clients sending in management requests: -

http://pilhuhn.blogspot.co.uk/2012/01/polyglot-management-of-secured-as7.html

You don't need to go as far as the Base64 encoding and decoding if you
do not want to and just create the json formatted requests and parse the
json responses.

Regards,
Darran Lofthouse.

On 29/05/15 13:11, Jairo Junior wrote:
> No, it's not. Only ruby. Although, I could use JRuby to import and use
> Java classes, it would give me more trouble than solutions.
>
> What I want is: An interoperable way to talk with JBoss. application/dmr
> is a binary/proprietary format.
>
> On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     What the constraints when developing a puppet module? Is plain java
>     supported?
>
>
>
>
>     Am 29.05.2015 um 01:39 schrieb Jairo Junior <[hidden email]
>     <mailto:[hidden email]>>:
>
>>     Heiko,
>>
>>     Thank you, but how do I build a ModelNode from a CLI command?
>>
>>     Before using JSON I was investigating how Administration Console
>>     perform operations and I realized (using firebug) that it uses
>>     application/dmr, but I presumed it uses ModelNode to build
>>     commands, not plain CLI syntax.
>>
>>     On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]
>>     <mailto:[hidden email]>> wrote:
>>
>>         The DMR library can be found here:
>>
>>         https://github.com/jbossas/jboss-dmr
>>
>>
>>>         On 28 May 2015, at 10:56, Heiko Braun <[hidden email]
>>>         <mailto:[hidden email]>> wrote:
>>>
>>>
>>>         You can already use DMR over HTTP. It requires a different
>>>         content-type ('application/dmr-encoded') and uses a base64
>>>         encoded representation of the payload
>>>         ('ModelNode.toBase64String()').
>>>
>>>         You can describe an operation through the DMR API and then
>>>         simply do HTTP POST to ‘/management’ endpoint. make sure to
>>>         use 'application/dmr-encoded’ for both 'Content-Type' and
>>>         ‘Accept’ headers.
>>>
>>>         The response can be parse using 'ModelNode.fromBase64()'.
>>>
>>>         Hope this helps,
>>>         Heiko
>>>
>>>
>>>
>>>>         On 27 May 2015, at 19:54, Jairo Junior
>>>>         <[hidden email] <mailto:[hidden email]>>
>>>>         wrote:
>>>>
>>>>         I've been working on a Puppet Module for Wildfly [1] that
>>>>         uses his HTTP Management API to perform operations (manage
>>>>         resources/deploys and execute commands), but my command
>>>>         execution code is a little bit limited cause I have to
>>>>         transform from CLI syntax to JSON. e.g.:
>>>>
>>>>         :shutdown(restart=true)
>>>>
>>>>         becomes
>>>>
>>>>         {"operation" : "shutdown", "restart" : "true" }
>>>>
>>>>         Is there any specific reason to not support plain CLI
>>>>         commands through HTTP API? I looked at the code and it
>>>>         didn't see hard to implement this...
>>>>
>>>>         [1] https://github.com/biemond/biemond-wildfly
>>>>
>>>>         _______________________________________________
>>>>         wildfly-dev mailing list
>>>>         [hidden email] <mailto:[hidden email]>
>>>>         https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>>
>>
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Darran Lofthouse
What we really have internally is a HTTP management interface and we
used to expose a native (JBoss Remoting) management interface that the
CLI would connect to - subsequently the CLI does connect to the HTTP
management interface but it performs a HTTP upgrade to now talk Remoting
over HTTP using DMR formatted messages.

For the HTTP management interface json was selected as the payload type
so that clients could be written in many languages that have libraries
to talk HTTP and handle json.

The CLI was then subsequently developed but with an emphasis on
assisting administrators constructing a request so things like tab
completion and automatic conversion.

A couple of things this thread throws up that I think could be useful: -
  - The ability to enter raw json requests into the CLI.
  - The ability to output the json representation of a command
constructed by the CLI.

Regards,
Darran Lofthouse.


On 29/05/15 13:38, Jairo Junior wrote:

> Darran,
>
> Thank you, wish I had found your blog post before. Fortunately, I was
> able to build almost the same thing with a lot of effort:
> https://github.com/biemond/biemond-wildfly/blob/master/lib/puppet_x/util/wildfly_cli.rb
>
> My point is: Sysadmins often build CLI scripts to automate tasks and I
> want to "reuse" this knowledge in HTTP API. Sysadmins don't talk JSON,
> they talk CLI...
>
> I heard somewhere that jboss-cli.sh and Management Console are using the
> same HTTP API in Wildfly, but I'm not sure how jboss-cli.sh use this
> commands...
>
> In fact, I tried to use jboss-cli.sh but bash is incredible slow
> compared to HTTP API:
> https://github.com/cpitman/puppet-jboss_admin/issues/68
>
> On Fri, May 29, 2015 at 9:22 AM Darran Lofthouse
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     It was written a couple of years back but this is a good blog post to
>     look at for different clients sending in management requests: -
>
>     http://pilhuhn.blogspot.co.uk/2012/01/polyglot-management-of-secured-as7.html
>
>     You don't need to go as far as the Base64 encoding and decoding if you
>     do not want to and just create the json formatted requests and parse the
>     json responses.
>
>     Regards,
>     Darran Lofthouse.
>
>     On 29/05/15 13:11, Jairo Junior wrote:
>      > No, it's not. Only ruby. Although, I could use JRuby to import
>     and use
>      > Java classes, it would give me more trouble than solutions.
>      >
>      > What I want is: An interoperable way to talk with JBoss.
>     application/dmr
>      > is a binary/proprietary format.
>      >
>      > On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     What the constraints when developing a puppet module? Is
>     plain java
>      >     supported?
>      >
>      >
>      >
>      >
>      >     Am 29.05.2015 um 01:39 schrieb Jairo Junior
>     <[hidden email] <mailto:[hidden email]>
>      >     <mailto:[hidden email]
>     <mailto:[hidden email]>>>:
>      >
>      >>     Heiko,
>      >>
>      >>     Thank you, but how do I build a ModelNode from a CLI command?
>      >>
>      >>     Before using JSON I was investigating how Administration Console
>      >>     perform operations and I realized (using firebug) that it uses
>      >>     application/dmr, but I presumed it uses ModelNode to build
>      >>     commands, not plain CLI syntax.
>      >>
>      >>     On Thu, May 28, 2015 at 5:58 AM Heiko Braun
>     <[hidden email] <mailto:[hidden email]>
>      >>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >>
>      >>         The DMR library can be found here:
>      >>
>      >> https://github.com/jbossas/jboss-dmr
>      >>
>      >>
>      >>>         On 28 May 2015, at 10:56, Heiko Braun
>     <[hidden email] <mailto:[hidden email]>
>      >>>         <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>      >>>
>      >>>
>      >>>         You can already use DMR over HTTP. It requires a different
>      >>>         content-type ('application/dmr-encoded') and uses a base64
>      >>>         encoded representation of the payload
>      >>>         ('ModelNode.toBase64String()').
>      >>>
>      >>>         You can describe an operation through the DMR API and then
>      >>>         simply do HTTP POST to ‘/management’ endpoint. make sure to
>      >>>         use 'application/dmr-encoded’ for both 'Content-Type' and
>      >>>         ‘Accept’ headers.
>      >>>
>      >>>         The response can be parse using 'ModelNode.fromBase64()'.
>      >>>
>      >>>         Hope this helps,
>      >>>         Heiko
>      >>>
>      >>>
>      >>>
>      >>>>         On 27 May 2015, at 19:54, Jairo Junior
>      >>>>         <[hidden email]
>     <mailto:[hidden email]> <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>      >>>>         wrote:
>      >>>>
>      >>>>         I've been working on a Puppet Module for Wildfly [1] that
>      >>>>         uses his HTTP Management API to perform operations (manage
>      >>>>         resources/deploys and execute commands), but my command
>      >>>>         execution code is a little bit limited cause I have to
>      >>>>         transform from CLI syntax to JSON. e.g.:
>      >>>>
>      >>>>         :shutdown(restart=true)
>      >>>>
>      >>>>         becomes
>      >>>>
>      >>>>         {"operation" : "shutdown", "restart" : "true" }
>      >>>>
>      >>>>         Is there any specific reason to not support plain CLI
>      >>>>         commands through HTTP API? I looked at the code and it
>      >>>>         didn't see hard to implement this...
>      >>>>
>      >>>>         [1] https://github.com/biemond/biemond-wildfly
>      >>>>
>      >>>>         _______________________________________________
>      >>>>         wildfly-dev mailing list
>      >>>> [hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      >>>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>      >>>
>      >>
>      >
>      >
>      > _______________________________________________
>      > wildfly-dev mailing list
>      > [hidden email] <mailto:[hidden email]>
>      > https://lists.jboss.org/mailman/listinfo/wildfly-dev
>      >
>
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Ladislav Thon
In reply to this post by Jairo Junior
> What I want is: An interoperable way to talk with JBoss. application/dmr
> is a binary/proprietary format.

It's also fairly small, self-contained and easy to reimplement, as proven by

https://github.com/hal/dmr.js
https://github.com/hal/dmr.dart
https://github.com/hal/dmr.scala

I'm not aware of a Ruby implementation, but it shouldn't be _that_ hard
to build.

Then, parsing the CLI strings into a ModelNode structure should be
fairly simple too... for those CLI commands that translate directly to
management operations.

The "local" CLI commands (e.g. "batch", "patch" or "if") require
client-side processing, and that is a whole new can of worms.

LT

>
> On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     What the constraints when developing a puppet module? Is plain java
>     supported?
>
>
>
>
>     Am 29.05.2015 um 01:39 schrieb Jairo Junior <[hidden email]
>     <mailto:[hidden email]>>:
>
>>     Heiko,
>>
>>     Thank you, but how do I build a ModelNode from a CLI command?
>>
>>     Before using JSON I was investigating how Administration Console
>>     perform operations and I realized (using firebug) that it uses
>>     application/dmr, but I presumed it uses ModelNode to build
>>     commands, not plain CLI syntax.
>>
>>     On Thu, May 28, 2015 at 5:58 AM Heiko Braun <[hidden email]
>>     <mailto:[hidden email]>> wrote:
>>
>>         The DMR library can be found here:
>>
>>         https://github.com/jbossas/jboss-dmr
>>
>>
>>>         On 28 May 2015, at 10:56, Heiko Braun <[hidden email]
>>>         <mailto:[hidden email]>> wrote:
>>>
>>>
>>>         You can already use DMR over HTTP. It requires a different
>>>         content-type ('application/dmr-encoded') and uses a base64
>>>         encoded representation of the payload
>>>         ('ModelNode.toBase64String()').
>>>
>>>         You can describe an operation through the DMR API and then
>>>         simply do HTTP POST to ‘/management’ endpoint. make sure to
>>>         use 'application/dmr-encoded’ for both 'Content-Type' and
>>>         ‘Accept’ headers.
>>>
>>>         The response can be parse using 'ModelNode.fromBase64()'.
>>>
>>>         Hope this helps,
>>>         Heiko
>>>
>>>
>>>
>>>>         On 27 May 2015, at 19:54, Jairo Junior
>>>>         <[hidden email] <mailto:[hidden email]>>
>>>>         wrote:
>>>>
>>>>         I've been working on a Puppet Module for Wildfly [1] that
>>>>         uses his HTTP Management API to perform operations (manage
>>>>         resources/deploys and execute commands), but my command
>>>>         execution code is a little bit limited cause I have to
>>>>         transform from CLI syntax to JSON. e.g.:
>>>>
>>>>         :shutdown(restart=true)
>>>>
>>>>         becomes
>>>>
>>>>         {"operation" : "shutdown", "restart" : "true" }
>>>>
>>>>         Is there any specific reason to not support plain CLI
>>>>         commands through HTTP API? I looked at the code and it
>>>>         didn't see hard to implement this...
>>>>
>>>>         [1] https://github.com/biemond/biemond-wildfly
>>>>
>>>>         _______________________________________________
>>>>         wildfly-dev mailing list
>>>>         [hidden email] <mailto:[hidden email]>
>>>>         https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>>
>>
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Alexey Loubyansky
In reply to this post by Darran Lofthouse
On 05/29/2015 02:51 PM, Darran Lofthouse wrote:

> What we really have internally is a HTTP management interface and we
> used to expose a native (JBoss Remoting) management interface that the
> CLI would connect to - subsequently the CLI does connect to the HTTP
> management interface but it performs a HTTP upgrade to now talk Remoting
> over HTTP using DMR formatted messages.
>
> For the HTTP management interface json was selected as the payload type
> so that clients could be written in many languages that have libraries
> to talk HTTP and handle json.
>
> The CLI was then subsequently developed but with an emphasis on
> assisting administrators constructing a request so things like tab
> completion and automatic conversion.
>
> A couple of things this thread throws up that I think could be useful: -
>    - The ability to enter raw json requests into the CLI.

There is a Jira issue open for this
https://issues.jboss.org/browse/WFCORE-418

>    - The ability to output the json representation of a command
> constructed by the CLI.

This is an easy one. There is echo-dmr command already. It could accept
--json argument to further transform the result to JSON.


Alexey

>
> Regards,
> Darran Lofthouse.
>
>
> On 29/05/15 13:38, Jairo Junior wrote:
>> Darran,
>>
>> Thank you, wish I had found your blog post before. Fortunately, I was
>> able to build almost the same thing with a lot of effort:
>> https://github.com/biemond/biemond-wildfly/blob/master/lib/puppet_x/util/wildfly_cli.rb
>>
>> My point is: Sysadmins often build CLI scripts to automate tasks and I
>> want to "reuse" this knowledge in HTTP API. Sysadmins don't talk JSON,
>> they talk CLI...
>>
>> I heard somewhere that jboss-cli.sh and Management Console are using the
>> same HTTP API in Wildfly, but I'm not sure how jboss-cli.sh use this
>> commands...
>>
>> In fact, I tried to use jboss-cli.sh but bash is incredible slow
>> compared to HTTP API:
>> https://github.com/cpitman/puppet-jboss_admin/issues/68
>>
>> On Fri, May 29, 2015 at 9:22 AM Darran Lofthouse
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>      It was written a couple of years back but this is a good blog post to
>>      look at for different clients sending in management requests: -
>>
>>      http://pilhuhn.blogspot.co.uk/2012/01/polyglot-management-of-secured-as7.html
>>
>>      You don't need to go as far as the Base64 encoding and decoding if you
>>      do not want to and just create the json formatted requests and parse the
>>      json responses.
>>
>>      Regards,
>>      Darran Lofthouse.
>>
>>      On 29/05/15 13:11, Jairo Junior wrote:
>>       > No, it's not. Only ruby. Although, I could use JRuby to import
>>      and use
>>       > Java classes, it would give me more trouble than solutions.
>>       >
>>       > What I want is: An interoperable way to talk with JBoss.
>>      application/dmr
>>       > is a binary/proprietary format.
>>       >
>>       > On Fri, May 29, 2015 at 8:17 AM Heiko Braun <[hidden email]
>>      <mailto:[hidden email]>
>>       > <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>>       >
>>       >     What the constraints when developing a puppet module? Is
>>      plain java
>>       >     supported?
>>       >
>>       >
>>       >
>>       >
>>       >     Am 29.05.2015 um 01:39 schrieb Jairo Junior
>>      <[hidden email] <mailto:[hidden email]>
>>       >     <mailto:[hidden email]
>>      <mailto:[hidden email]>>>:
>>       >
>>       >>     Heiko,
>>       >>
>>       >>     Thank you, but how do I build a ModelNode from a CLI command?
>>       >>
>>       >>     Before using JSON I was investigating how Administration Console
>>       >>     perform operations and I realized (using firebug) that it uses
>>       >>     application/dmr, but I presumed it uses ModelNode to build
>>       >>     commands, not plain CLI syntax.
>>       >>
>>       >>     On Thu, May 28, 2015 at 5:58 AM Heiko Braun
>>      <[hidden email] <mailto:[hidden email]>
>>       >>     <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>>       >>
>>       >>         The DMR library can be found here:
>>       >>
>>       >> https://github.com/jbossas/jboss-dmr
>>       >>
>>       >>
>>       >>>         On 28 May 2015, at 10:56, Heiko Braun
>>      <[hidden email] <mailto:[hidden email]>
>>       >>>         <mailto:[hidden email] <mailto:[hidden email]>>>
>>      wrote:
>>       >>>
>>       >>>
>>       >>>         You can already use DMR over HTTP. It requires a different
>>       >>>         content-type ('application/dmr-encoded') and uses a base64
>>       >>>         encoded representation of the payload
>>       >>>         ('ModelNode.toBase64String()').
>>       >>>
>>       >>>         You can describe an operation through the DMR API and then
>>       >>>         simply do HTTP POST to ‘/management’ endpoint. make sure to
>>       >>>         use 'application/dmr-encoded’ for both 'Content-Type' and
>>       >>>         ‘Accept’ headers.
>>       >>>
>>       >>>         The response can be parse using 'ModelNode.fromBase64()'.
>>       >>>
>>       >>>         Hope this helps,
>>       >>>         Heiko
>>       >>>
>>       >>>
>>       >>>
>>       >>>>         On 27 May 2015, at 19:54, Jairo Junior
>>       >>>>         <[hidden email]
>>      <mailto:[hidden email]> <mailto:[hidden email]
>>      <mailto:[hidden email]>>>
>>       >>>>         wrote:
>>       >>>>
>>       >>>>         I've been working on a Puppet Module for Wildfly [1] that
>>       >>>>         uses his HTTP Management API to perform operations (manage
>>       >>>>         resources/deploys and execute commands), but my command
>>       >>>>         execution code is a little bit limited cause I have to
>>       >>>>         transform from CLI syntax to JSON. e.g.:
>>       >>>>
>>       >>>>         :shutdown(restart=true)
>>       >>>>
>>       >>>>         becomes
>>       >>>>
>>       >>>>         {"operation" : "shutdown", "restart" : "true" }
>>       >>>>
>>       >>>>         Is there any specific reason to not support plain CLI
>>       >>>>         commands through HTTP API? I looked at the code and it
>>       >>>>         didn't see hard to implement this...
>>       >>>>
>>       >>>>         [1] https://github.com/biemond/biemond-wildfly
>>       >>>>
>>       >>>>         _______________________________________________
>>       >>>>         wildfly-dev mailing list
>>       >>>> [hidden email]
>>      <mailto:[hidden email]>
>>      <mailto:[hidden email]
>>      <mailto:[hidden email]>>
>>       >>>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>       >>>
>>       >>
>>       >
>>       >
>>       > _______________________________________________
>>       > wildfly-dev mailing list
>>       > [hidden email] <mailto:[hidden email]>
>>       > https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>       >
>>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

jtgreene
Administrator

> On May 29, 2015, at 9:34 AM, Alexey Loubyansky <[hidden email]> wrote:
>
> On 05/29/2015 02:51 PM, Darran Lofthouse wrote:
>> What we really have internally is a HTTP management interface and we
>> used to expose a native (JBoss Remoting) management interface that the
>> CLI would connect to - subsequently the CLI does connect to the HTTP
>> management interface but it performs a HTTP upgrade to now talk Remoting
>> over HTTP using DMR formatted messages.
>>
>> For the HTTP management interface json was selected as the payload type
>> so that clients could be written in many languages that have libraries
>> to talk HTTP and handle json.
>>
>> The CLI was then subsequently developed but with an emphasis on
>> assisting administrators constructing a request so things like tab
>> completion and automatic conversion.
>>
>> A couple of things this thread throws up that I think could be useful: -
>>   - The ability to enter raw json requests into the CLI.
>
> There is a Jira issue open for this
> https://issues.jboss.org/browse/WFCORE-418
>
>>   - The ability to output the json representation of a command
>> constructed by the CLI.
>
> This is an easy one. There is echo-dmr command already. It could accept
> --json argument to further transform the result to JSON.

Additionally I think we need:

- Ability to transform a ModelNode into CLI calls, and potentially code in various languages (WFCORE-721)
- Enhance the HTTP server API to follow REST patterns, including JSON patching (WFCORE-722)
- Add support for CLI style addressing within a ModelNode operation (instead of doing a list of kv pairs, you just pass it a CLI style address string(“/foo=bar/blah=something/etc=etc”)

--
Jason T. Greene
WildFly Lead / JBoss EAP Platform Architect
JBoss, a division of Red Hat


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Emmanuel Hugonnet


Le 29/05/2015 18:52, Jason Greene a écrit :

>
>> On May 29, 2015, at 9:34 AM, Alexey Loubyansky <[hidden email]> wrote:
>>
>> On 05/29/2015 02:51 PM, Darran Lofthouse wrote:
>>> What we really have internally is a HTTP management interface and we
>>> used to expose a native (JBoss Remoting) management interface that the
>>> CLI would connect to - subsequently the CLI does connect to the HTTP
>>> management interface but it performs a HTTP upgrade to now talk Remoting
>>> over HTTP using DMR formatted messages.
>>>
>>> For the HTTP management interface json was selected as the payload type
>>> so that clients could be written in many languages that have libraries
>>> to talk HTTP and handle json.
>>>
>>> The CLI was then subsequently developed but with an emphasis on
>>> assisting administrators constructing a request so things like tab
>>> completion and automatic conversion.
>>>
>>> A couple of things this thread throws up that I think could be useful: -
>>>   - The ability to enter raw json requests into the CLI.
>>
>> There is a Jira issue open for this
>> https://issues.jboss.org/browse/WFCORE-418
>>
>>>   - The ability to output the json representation of a command
>>> constructed by the CLI.
>>
>> This is an easy one. There is echo-dmr command already. It could accept
>> --json argument to further transform the result to JSON.
>
> Additionally I think we need:
>
> - Ability to transform a ModelNode into CLI calls, and potentially code in various languages (WFCORE-721)
> - Enhance the HTTP server API to follow REST patterns, including JSON patching (WFCORE-722)
> - Add support for CLI style addressing within a ModelNode operation (instead of doing a list of kv pairs, you just pass it a CLI style address string(“/foo=bar/blah=something/etc=etc”)
This last bit is already in WF9 ;) https://issues.jboss.org/browse/WFCORE-537
Emmanuel

>
> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

jtgreene
Administrator

> On May 29, 2015, at 12:27 PM, Emmanuel Hugonnet <[hidden email]> wrote:
>
>
>
> Le 29/05/2015 18:52, Jason Greene a écrit :
>>
>>> On May 29, 2015, at 9:34 AM, Alexey Loubyansky <[hidden email]> wrote:
>>>
>>>> On 05/29/2015 02:51 PM, Darran Lofthouse wrote:
>>>> What we really have internally is a HTTP management interface and we
>>>> used to expose a native (JBoss Remoting) management interface that the
>>>> CLI would connect to - subsequently the CLI does connect to the HTTP
>>>> management interface but it performs a HTTP upgrade to now talk Remoting
>>>> over HTTP using DMR formatted messages.
>>>>
>>>> For the HTTP management interface json was selected as the payload type
>>>> so that clients could be written in many languages that have libraries
>>>> to talk HTTP and handle json.
>>>>
>>>> The CLI was then subsequently developed but with an emphasis on
>>>> assisting administrators constructing a request so things like tab
>>>> completion and automatic conversion.
>>>>
>>>> A couple of things this thread throws up that I think could be useful: -
>>>>  - The ability to enter raw json requests into the CLI.
>>>
>>> There is a Jira issue open for this
>>> https://issues.jboss.org/browse/WFCORE-418
>>>
>>>>  - The ability to output the json representation of a command
>>>> constructed by the CLI.
>>>
>>> This is an easy one. There is echo-dmr command already. It could accept
>>> --json argument to further transform the result to JSON.
>>
>> Additionally I think we need:
>>
>> - Ability to transform a ModelNode into CLI calls, and potentially code in various languages (WFCORE-721)
>> - Enhance the HTTP server API to follow REST patterns, including JSON patching (WFCORE-722)
>> - Add support for CLI style addressing within a ModelNode operation (instead of doing a list of kv pairs, you just pass it a CLI style address string(“/foo=bar/blah=something/etc=etc”)
>
> This last bit is already in WF9 ;) https://issues.jboss.org/browse/WFCORE-537
> Emmanuel

Awesome! I didn't realize it was already in.

>
>>
>> --
>> Jason T. Greene
>> WildFly Lead / JBoss EAP Platform Architect
>> JBoss, a division of Red Hat
>>
>>
>> _______________________________________________
>> wildfly-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

kkhan
In reply to this post by jtgreene

> On 29 May 2015, at 18:52, Jason Greene <[hidden email]> wrote:
>
>
>> On May 29, 2015, at 9:34 AM, Alexey Loubyansky <[hidden email]> wrote:
>>
>> On 05/29/2015 02:51 PM, Darran Lofthouse wrote:
>>> What we really have internally is a HTTP management interface and we
>>> used to expose a native (JBoss Remoting) management interface that the
>>> CLI would connect to - subsequently the CLI does connect to the HTTP
>>> management interface but it performs a HTTP upgrade to now talk Remoting
>>> over HTTP using DMR formatted messages.
>>>
>>> For the HTTP management interface json was selected as the payload type
>>> so that clients could be written in many languages that have libraries
>>> to talk HTTP and handle json.
>>>
>>> The CLI was then subsequently developed but with an emphasis on
>>> assisting administrators constructing a request so things like tab
>>> completion and automatic conversion.
>>>
>>> A couple of things this thread throws up that I think could be useful: -
>>>  - The ability to enter raw json requests into the CLI.
>>
>> There is a Jira issue open for this
>> https://issues.jboss.org/browse/WFCORE-418
>>
>>>  - The ability to output the json representation of a command
>>> constructed by the CLI.
>>
>> This is an easy one. There is echo-dmr command already. It could accept
>> --json argument to further transform the result to JSON.
>
> Additionally I think we need:
>
> - Ability to transform a ModelNode into CLI calls, and potentially code in various languages (WFCORE-721)
> - Enhance the HTTP server API to follow REST patterns, including JSON patching (WFCORE-722)
I plan on working on this soon (once I’ve finished with Emanuel’s domain operations work)

> - Add support for CLI style addressing within a ModelNode operation (instead of doing a list of kv pairs, you just pass it a CLI style address string(“/foo=bar/blah=something/etc=etc”)
>
> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: HTTP API support for plain JBoss-CLI commands

Brian Stansberry
In reply to this post by jtgreene
On 5/29/15 12:48 PM, Jason T. Greene wrote:

>
>> On May 29, 2015, at 12:27 PM, Emmanuel Hugonnet <[hidden email]> wrote:
>>
>>
>>
>> Le 29/05/2015 18:52, Jason Greene a écrit :
>>>
>>>> On May 29, 2015, at 9:34 AM, Alexey Loubyansky <[hidden email]> wrote:
>>>>
>>>>> On 05/29/2015 02:51 PM, Darran Lofthouse wrote:
>>>>> What we really have internally is a HTTP management interface and we
>>>>> used to expose a native (JBoss Remoting) management interface that the
>>>>> CLI would connect to - subsequently the CLI does connect to the HTTP
>>>>> management interface but it performs a HTTP upgrade to now talk Remoting
>>>>> over HTTP using DMR formatted messages.
>>>>>
>>>>> For the HTTP management interface json was selected as the payload type
>>>>> so that clients could be written in many languages that have libraries
>>>>> to talk HTTP and handle json.
>>>>>
>>>>> The CLI was then subsequently developed but with an emphasis on
>>>>> assisting administrators constructing a request so things like tab
>>>>> completion and automatic conversion.
>>>>>
>>>>> A couple of things this thread throws up that I think could be useful: -
>>>>>   - The ability to enter raw json requests into the CLI.
>>>>
>>>> There is a Jira issue open for this
>>>> https://issues.jboss.org/browse/WFCORE-418
>>>>
>>>>>   - The ability to output the json representation of a command
>>>>> constructed by the CLI.
>>>>
>>>> This is an easy one. There is echo-dmr command already. It could accept
>>>> --json argument to further transform the result to JSON.
>>>
>>> Additionally I think we need:
>>>
>>> - Ability to transform a ModelNode into CLI calls, and potentially code in various languages (WFCORE-721)
>>> - Enhance the HTTP server API to follow REST patterns, including JSON patching (WFCORE-722)
>>> - Add support for CLI style addressing within a ModelNode operation (instead of doing a list of kv pairs, you just pass it a CLI style address string(“/foo=bar/blah=something/etc=etc”)
>>
>> This last bit is already in WF9 ;) https://issues.jboss.org/browse/WFCORE-537
>> Emmanuel
>
> Awesome! I didn't realize it was already in.
>

That handles the address param in a more friendly fashion, but it's not
full support of CLI syntax. That is this works now:

{
  "operation"="add",
  "address"="/foo=bar/blah=something/etc=etc",
  "thingy"=2
}

but "/foo=bar/blah=something/etc=etc:add(thingy=2)" would not.

>>
>>>
>>> --
>>> Jason T. Greene
>>> WildFly Lead / JBoss EAP Platform Architect
>>> JBoss, a division of Red Hat
>>>
>>>
>>> _______________________________________________
>>> wildfly-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>>
>
> _______________________________________________
> wildfly-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>


--
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev