I'm trying to cancel a running build via the API. When I POST, as instructed by the docs, I get a 405 response with this content:
Error has occurred during request processing (405).\nError: javax.ws.rs.WebApplicationException\nNot supported request. Please check URL, HTTP method and transfered data are correct. metadata: [Allow:[GET,DELETE,OPTIONS,HEAD],]
This tells me that POST is not supported. And the build is not cancelled.
Since I saw DELETE in the list of supported methods, I tried that. DELETE does cancel the build, but returns a 400 with this message:
Error has occurred during request processing (Bad Request).\nError: jetbrains.buildServer.server.rest.errors.BadRequestException: Deleting not finished builds is not supported. Cancel the build and only then delete it.\nInvalid request. Please check the request URL and data are correct.
Am I doing it wrong?