Rest API for restart service is not working
Summary:
Below groovy rule is running fine, but the services are not getting restarted, i have tried with both v1 & v2 versions but rule ran fine but services didnt restart.
Same username pwd able to restart services through epm automate.
/*Groovy Rule*/
def connection = operation.application.getConnection("EDM")
def body = [
comment: "Restart by Admin using REST API"
]
def response = connection
.post("/interop/rest/v2/config/services/reset")
.header("Content-Type", "application/json")
.body(JsonOutput.toJson(body))
.asString()
println "HTTP Status : ${response.status}"
println "Response : ${response.body}"
if(response.status == 200 || response.status == 202){
println "Restart request submitted."
} else {
throwVetoException("Restart failed. Status=${response.status}\n${response.body}")