Lifecycle actions¶
This page covers the action verbs that change a Workload's runtime state. For the underlying lifetime policies—draft TTL (time-to-live), locked indefinite lifetime, and the Workloads-per-artifact rules—see Workload concepts: Lifetime policies.
開始¶
Start a stopped Workload with POST /workloads/{id}/start. The platform schedules the proton and returns 202 with a WorkloadOperationResponse; poll GET /workloads/{id} to observe the status transition through submitted -> provisioning -> launching -> running.
curl -X POST "${DATAROBOT_ENDPOINT}/workloads/${WORKLOAD_ID}/start" \
-H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
停止¶
Stop a running Workload with POST /workloads/{id}/stop. The platform begins graceful shutdown; the Workload object and its metadata persist, and you can restart it later. Restarting a draft Workload resets the 8-hour TTL.
curl -X POST "${DATAROBOT_ENDPOINT}/workloads/${WORKLOAD_ID}/stop" \
-H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
削除¶
Use stop when you want to pause execution but keep the Workload object and its metadata. Use delete to remove the Workload entirely; delete tears down protons and invoke routing for that identity.
curl -X DELETE "${DATAROBOT_ENDPOINT}/workloads/${WORKLOAD_ID}" \
-H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
Deletion returns:
- A
204on clean deletion. 502with a detail message if the Workload was deleted but one or more protons could not be stopped.
Draft Workloads still honor the 8-hour TTL described in Draft TTL; use delete to remove them sooner.
Draft TTL¶
A Workload's TTL (time-to-live) is the timer that controls when the platform auto-terminates it. Draft-artifact Workloads have an 8-hour TTL: the Workload is removed 8 hours after creation, freeing the resources for other work. See Workload concepts: Draft (ephemeral) for how the TTL supports fast iteration.
The TTL resets to 8 hours each time the Workload restarts, so a stopped-then-started draft Workload gets another 8-hour window. To remove the TTL on a Workload you've already created, promote it: Promote to production locks the artifact and switches the Workload to indefinite lifetime in place. Locked Workloads have no TTL and run until you stop or delete them.
For the full draft and locked policy rules, see Workload concepts: Lifetime policies. For a minimal example of stopping a draft hello-world Workload before its TTL elapses, see Hello, Workload.