Delete a single deployment
From these docs...
https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/delete/
...you should be able to run this curl to delete a deployment:
I know how to fill in all of the parameters except
{script_name}
. TBH it seems like curl -X DELETE
and {deployment_id}
should give the API sufficient information to do the job, but leaving that aside, what value is meant to be used for {script_name}
in order to delete the deployment?11 Replies
The name of the Worker itself?
Where are you getting the
deployment_id
from?From the dashboard for the worker on the "Deployments" tab. So I guess the
deployment_id
s listed there are not unique within the account_id
and need to be scoped to the worker? In that case I would excpect the parameter to be called worker_name
not script_name
, but it sounds like you're saying the worker name is what goes there correct?Yeah, that should be it
deployment is a guid but either way, yes, script = worker
script is mostly just legacy naming
Ah cool, makes sense now, thank you both.
Huh, that didn't work, I got this error:
but I copied the deployment id from the worker's dashboard, so it does exist on the worker, at least according to the dashboard.
are you using the deployment or version id
Ah, it does say version id next to each deployment, I assumed that was the deployment id, I guess it's not. Where can I find the actual deployment ids?
it doesn't look like the UI shows them... if you go to "Deployment history" and then open dev tools, it's in the /deployments API call
That worked, cheers Walshy. Btw, that "Deployment History" page updates so it no longer lists the deployment you deleted, but the page that shows the "Active Deployment" and "Version History" does not update, it still includes the version that was deleted in the list of versions. Not a big deal, just a heads up as it might be worth updating in both locations to avoid confusion.
IIRC that's because while you can delete a deployment, you cannot delete a version
I see, it would be nice to clean up the version history as well if that's something that could be implemented in the future.