Start Control Build
start_control_buildStart a proposed control build for a threat model: first return an estimate without charging, then confirm with model_version and set_revision to queue the build and consume credits.
Instructions
Start the model's proposed control build. Mutating only with
confirm_estimate=True; consumes credits then.
A model's controls are built only by a build someone starts. Generating
or refining the model, editing an entity and regenerate_controls
each PROPOSE one; get_control_generation_status shows it as
proposal.
Call with
confirm_estimate=False(the default). Nothing starts and nothing is charged; the answer is{started: false, proposal, message}, the proposal carrying a freshestimated_creditsand themodel_versionandset_revisionthe model stands at. Show the user what it would build and cost.Call again with
confirm_estimate=Trueand those two values once they have reviewed the model. The build starts ({started: true, job_id, model_version, status: "queued", status_detail}) and holds the model until it publishes, fails or is discarded: other writers of the model's controls are refused meanwhile, and reads show the last published controls. Pollget_control_generation_statusuntilterminal; the publish is one step, after whichget_controlsshows the result.
Refusals come back as data:
{started: false, http_status: 404, code: "no_proposal"}— nothing is proposed for the model.{started: false, http_status: 409, code: "review_stale", proposal, model_version, set_revision, estimated_credits}— the model or its controls changed since the values were read (or none were named). Review again and start with the values returned.{started: false, http_status: 409, code: "generation_active", status}— a build already holds the model.{started: false, http_status: 402, ...}— the balance this workspace bills to cannot cover the estimate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | ID of the threat model. | |
| set_revision | No | With ``confirm_estimate=True``: the proposal's ``set_revision``. | |
| model_version | No | With ``confirm_estimate=True``: the proposal's ``model_version``. | |
| server_version | Yes | ||
| confirm_estimate | No | False (default) returns the proposal and its estimate and starts nothing; True starts the build. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||