0
我對Wildfly很陌生,但我需要通過API設置對各個部署狀態的自動監視。使用curl/API查看Wildfly中的單個部署狀態
在,我可以捲曲查看服務器狀態,以同樣的方式,如:
curl --insecure --digest 'https://admin:[email protected]:9993/management' --header "Content-Type: application/json" -d '{"operation":"read-attribute","name":"server-state","json.pretty":1}'
返回結果:
{
"outcome" => "success",
"result" => "running"
}
以同樣的方式,從JBoss CLI,我發出:
:read-attribute(name=server-state)
並得到相同的結果。
因此,從CLI,如果我發出以下命令來獲取特定的部署狀態:
/deployment=bob :read-attribute(name=status)
我得到以下結果:
{
"outcome" => "success",
"result" => "OK"
}
但我不能弄清楚curl命令會給我什麼結果。我已經閱讀了大量的文檔,要麼它不存在,要麼我看錯了地方。我試過了:
curl --insecure --digest 'https://[email protected]:9993/management' --header "Content-Type: application/json" -d '{"deployment":"bob","operation":"read-attribute","name":"status","json.pretty":1}'
但是沒有奏效。有任何想法嗎?
謝謝, 馬克J.
謝謝詹姆斯。太棒了。 –