[英]Wildfly, restart server group
I need to restart a server group, using the HTTP API. 我需要使用HTTP API重新启动服务器组。 I can't figure out what the correct syntax is.
我不知道什么是正确的语法。
I tried a lot of 我尝试了很多
HashMap<String, Object> requestMap = new HashMap<>();
requestMap.put("operation", "something-something");
requestMap.put("address", "something-something");
final Response response = managementContext
.request()
.header("X-Requested-By", WildflyUtils.class.getName())
.post(Entity.json(requestMap));
or "by hand": 或“手动”:
{"operation":"something-something", "address":"something-something", "json.pretty":1}
I'm guessing around. 我在猜。 Does someone know which command is best and what the correct syntax for the address is, or where a useful documentation for the HTTP API is?
有人知道哪个命令最好,地址的正确语法是什么,或者HTTP API的有用文档在哪里? The official documentation ( https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API ) is somewhat small.
官方文档( https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API )很小。
You should take a look at WildFly 11.0 Model Reference , but I am afraid this does not cover the domain mode. 您应该看一下WildFly 11.0模型参考 ,但是恐怕这并不涵盖域模式。
I had a small demo code here . 我在这里有一个小演示代码。 In your case you should do:
在您的情况下,您应该执行以下操作:
requestMap.put("address", "[\"server-group",\"myServerGroup\"]");
requestMap.put("operation", "restart-servers");
requestMap.put("blocking", "true/false");
requestMap.put("start-mode", "normal/suspend");
I do not know whether it help but I tried with the curl: 我不知道是否有帮助,但是我尝试了一下curl:
curl --digest -u "username:password" 'http://localhost:9990/management' --header "Content-Type: application/json" -d '{"operation":"restart-servers","address":[{"server-group":"your_server_group"}]}'
for standalone: 对于独立版本:
curl --digest -u "username:password" 'http://localhost:9990/management' --header "Content-Type: application/json" -d '{"operation":"reload","address":[]}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.