Hi Team,
I have a release which is failed, but i need to change the status of the release from “FAILED” to “CANCELLED”.
I can see an option available to change the state manually, as seen in the below image.
But, i should change the state on fly through API, so i found a method from SWAGGER UI, from where i use below command to get the info the the particular release.
$OctopusAPIKey=“xyz”
$header = @{ “X-Octopus-ApiKey” = $OctopusAPIKey }
Invoke-WebRequest “http://octopus.xyz.com/api/tasks/ServerTasks-23030/” -Method get -Headers $header
from this am getting the info of the release, but when i use post method to change the state from failed to cancelled, by using below command.
$OctopusAPIKey=“xyz”
$header = @{ “X-Octopus-ApiKey” = $OctopusAPIKey }
Invoke-WebRequest “http://octopus.xyz.com/api/tasks/ServerTasks-23030/failed” -Method POST -Headers $header
I am getting either bad request error of “404 NOT FOUND” error.
Can you please help with this, as what is the perfect method to change the state of a release through API.
what should be modified from the above command so that i can change the state of release from API.
It will be very helpful, if we can change the state through API, you solution to this problem will help us a lot.
Thanks,
Shaik Sadiq