This content has been marked as final.
Show 3 replies
-
1. Re: curl - HTTP Management
dlofthouse Feb 24, 2012 11:48 AM (in response to cvasilak)Have you added a user for domain management? You are going to need to specify their username in the curl call and provide their password.
-
2. Re: curl - HTTP Management
ctomc Feb 24, 2012 12:29 PM (in response to cvasilak)Hi,
you can find an example how to call management with curl here:
https://docs.jboss.org/author/display/AS71/The+HTTP+management+API
--
tomaz
-
3. Re: curl - HTTP Management
cvasilak Feb 24, 2012 5:03 PM (in response to ctomc)thanks for your replies,
although I didn't show in the command line I was using basic authentication from curl. After changing to --digest all works ok e.g.
cvasilak@casper:~$ curl --digest -D - http://localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-resource", "address":["deployment","jolokia.war"], "json.pretty":1}' -u username:password HTTP/1.1 401 Unauthorized Content-length: 0 Www-authenticate: Digest realm="ManagementRealm",nonce="e371e4c9d9c8e9a54ba00f1211541fdb" Date: Fri, 24 Feb 2012 21:56:26 GMT HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: application/json Date: Fri, 24 Feb 2012 21:56:26 GMT { "outcome" : "success", "result" : { "content" : [{ "path" : "deployments/jolokia.war", "relative-to" : "jboss.server.base.dir", "archive" : true }], "enabled" : true, "name" : "jolokia.war", "persistent" : false, "runtime-name" : "jolokia.war", "subdeployment" : null, "subsystem" : {"web" : null}
As you can see the "address" part is a standard json array so after populating correctly it works fluently. Plus after changing the operation to "redeploy" the war was redeployed. So I guess I have the full power
Time for serious fun...
Thanks a lot!
Regards