Project Lifecycle
Learn how to stop and resume your project's execution via API.
Stop Project
Pauses the project execution.
PATCH /project/:id/stopPath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID (ObjectId) |
Response
{
"status": "success",
"data": {
"status": "stopped",
"message": "Project stopped"
}
}Resume Project
Resumes execution of a stopped project.
PATCH /project/:id/resumePath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID (ObjectId) |
Response
{
"status": "success",
"data": {
"status": "running",
"instances": 2
}
}Examples
Stop Project
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/stop" \
-H "x-api-key: your-api-key"Resume Project
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/resume" \
-H "x-api-key: your-api-key"Python
import requests
API_KEY = "your-api-key"
PROJECT_ID = "507f1f77bcf86cd799439011"
headers = {"x-api-key": API_KEY}
# Stop project
stop_response = requests.patch(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/stop",
headers=headers
).json()
print(stop_response)
# Resume project
resume_response = requests.patch(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/resume",
headers=headers
).json()
print(resume_response)Use Cases
- Maintenance: Pause the project during scheduled maintenance
- Cost savings: Pause projects that don't need to run continuously
- Testing: Pause test environments when not in use