Deploy API Get Start Environment Status

2
Hi! I want to restart a Mendix Application by using the Deploy API v1 and everything works fine apart from the ‘Get Start Environment Status’ call. I can stop the application and immediately afterwards send a start job. Then I get the JobID, which looks correct and if I try to wait for the application to start (by using the ‘Get Start Environment Status’ call in a loop), I get the HTTP response code 405 – job not found. I printed the URL which looks correct (https://deploy.mendix.com/api/1/apps/.../environments/acceptance/start/4e..….-….-….-….-65……….) and I had the same issue in Java and in a Powershell script, which has the same functionality.   Did anyone else have this issue?
asked
1 answers
2

Can you try doing the requests in Postman and see if you get the expected result?

Start environment:

Tests:

const response = pm.response.json();
pm.test("Received JobId", function () {
    let jobId = response.JobId;
    pm.expect(jobId).to.not.be.undefined;
    pm.collectionVariables.set("JobID", jobId);
});

 

Start status:

Tests:

const response = pm.response.json();

if (response.Status === "Starting") { 
    console.log("Environment is starting...");
    setTimeout(() => {}, 60000);
    postman.setNextRequest(pm.info.requestId);
}
pm.test("Environment has started", function () {
    pm.expect(response.Status).to.equal("Started");
});

 

answered