简体   繁体   中英

How to undeploy multiple WARs with single HTTP management API query in WildFly?

I undeploy a WAR using HTTP management API of Wildfly 10 the following way:

curl --digest -u admin:admin -L -H 'Content-Type: application/json'        \
      -d '{"address":[{"deployment":"my-war.war"}],"operation":"remove"}'  \
      http://localhost:9990/management

How to undeploy more than one WAR using one Wildfly HTTP management API request?

I can't find the solution in official docs: https://docs.jboss.org/author/WFLY10/The+HTTP+management+API https://docs.jboss.org/author/WFLY10/Application+deployment

I'm looking for JSON that can undeploy multiple WARs. I've tried some ways with JSON arrays, but to no avail. Some of them result in 500 - Internal Server Error, others fail with WFLYCTL0030 code.

Found it in the EAP 6.4 documentation

curl --digest -L -D - http://localhost:9990/management --header "Content-Type: application/json" -d '
{
   "operation":"composite",
   "address":[  
   ],
   "steps":[
      {
         "operation":"undeploy",
         "address":{
            "deployment":"my-war.war"
         }
      },
      {
         "operation":"remove",
         "address":{
            "deployment":"my-war.war"
         }
      },
      {
         "operation":"undeploy",
         "address":{  
            "deployment":"my-second-war.war"
         }
      },
      {
         "operation":"remove",
         "address":{
            "deployment":"my-second-war.war"
         }
      }
   ],
   "json.pretty":1
}' -u admin:admin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM