<div dir="ltr"><div><div>Heiko,<br><br></div>Thank you, but how do I build a ModelNode from a CLI command?<br><br></div>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.<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, May 28, 2015 at 5:58 AM Heiko Braun &lt;<a href="mailto:hbraun@redhat.com">hbraun@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The DMR library can be found here:<div><br></div><div><a href="https://github.com/jbossas/jboss-dmr" target="_blank">https://github.com/jbossas/jboss-dmr</a></div></div><div style="word-wrap:break-word"><div><br></div><div><br><div><blockquote type="cite"><div>On 28 May 2015, at 10:56, Heiko Braun &lt;<a href="mailto:hbraun@redhat.com" target="_blank">hbraun@redhat.com</a>&gt; wrote:</div><br><div><br>You can already use DMR over HTTP. It requires a different content-type (&#39;application/dmr-encoded&#39;) and uses a base64 encoded representation of the payload (&#39;ModelNode.toBase64String()&#39;). <br><br>You can describe an operation through the DMR API and then simply do HTTP POST to ‘/management’ endpoint. make sure to use &#39;application/dmr-encoded’ for both &#39;Content-Type&#39; and ‘Accept’ headers. <br><br>The response can be parse using &#39;ModelNode.fromBase64()&#39;.<br><br>Hope this helps,<br>Heiko<br><br><br><br><blockquote type="cite">On 27 May 2015, at 19:54, Jairo Junior &lt;<a href="mailto:junior.jairo1@gmail.com" target="_blank">junior.jairo1@gmail.com</a>&gt; wrote:<br><br>I&#39;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.:<br><br>:shutdown(restart=true)<br><br>becomes<br><br>{&quot;operation&quot; : &quot;shutdown&quot;, &quot;restart&quot; : &quot;true&quot; }<br><br>Is there any specific reason to not support plain CLI commands through HTTP API? I looked at the code and it didn&#39;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><br><a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br></blockquote><br></div></blockquote></div><br></div></div></blockquote></div>