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