ozzie
ozzie
Explore posts from servers
RRunPod
Created by Cemal on 3/18/2025 in #⚡|serverless
Terminate worker
I had a similar question recently which may be helpful to your question: https://discord.com/channels/912829806415085598/1351676903022530570 TL;DR is that there is a REST endpoint to delete an endpoint by id
13 replies
RRunPod
Created by ozzie on 3/18/2025 in #⚡|serverless
Delete Serverless Endpoint via the API?
But anyways, the REST endpoint solves my problem (automating inference evaluation runs programatically) so I'll move forward using that API moving forward. Thanks yall!
11 replies
RRunPod
Created by ozzie on 3/18/2025 in #⚡|serverless
Delete Serverless Endpoint via the API?
Got it, thank you for all the additional context. FWIW, I just retried the original sample and it is still experiencing the "Something went wrong. Please try again later or contact support" error so the failure isn't intermittent. Let me know if there is any additional details that would be helpful for debugging
11 replies
RRunPod
Created by ozzie on 3/18/2025 in #⚡|serverless
Delete Serverless Endpoint via the API?
fwiw, I also didn't scale down my worker before deleting (I am able to call that endpoint with two active workers). This is fine for my usage case, I just wanted to surface in case that's unexpected behavior
11 replies
RRunPod
Created by ozzie on 3/18/2025 in #⚡|serverless
Delete Serverless Endpoint via the API?
Hm yes, that worked
async def delete_endpoint(endpoint_id: str):
try:
url = f"https://rest.runpod.io/v1/endpoints/{endpoint_id}"
headers = {"Authorization": f"Bearer {os.getenv('RUNPOD_API_KEY')}"}

response = requests.delete(url, headers=headers)
if response.status_code != 200:
raise Exception(
f"Failed to delete endpoint {endpoint_id}: {response.json()}"
)
except Exception as e:
print(e)
print_warning(
f"Failed to delete endpoint {endpoint_id}: {e}Please delete it manually."
)
async def delete_endpoint(endpoint_id: str):
try:
url = f"https://rest.runpod.io/v1/endpoints/{endpoint_id}"
headers = {"Authorization": f"Bearer {os.getenv('RUNPOD_API_KEY')}"}

response = requests.delete(url, headers=headers)
if response.status_code != 200:
raise Exception(
f"Failed to delete endpoint {endpoint_id}: {response.json()}"
)
except Exception as e:
print(e)
print_warning(
f"Failed to delete endpoint {endpoint_id}: {e}Please delete it manually."
)
Any reason why the REST endpoint worked?
11 replies