I'm trying to invoke the marathon API to suspend a job. I don't see in the API docs how to do it, but I thought that I could do it by setting instance = 0. But all that's done is cause my job to enter the "Deploying..." state (apparently forever). On the other hand, when I suspend a job using the marathon web portal, it gets suspended right away.
Does anyone know how to do this?
$.fn.suspendjob = function(id) {
$.ajax({
type: 'PUT',
url: 'https://mesos-head.achillesv.net/marathon/v2/apps' + id,
headers: {
"Authorization": "Basic " + btoa(user + ":" + pass)
},
data: JSON.stringify({ instances: 0}),
contentType: "application/json; charset=utf-8",
success: function(result) {
appslist.length = 0;
$('#tabs').tabs("option", "active", 1);
$('#tabs').tabs("option", "active", 0);
}
});
};