apphost.machine.claim ​
Claim hosted compute for an AppHost site: enforce subscription and live-machine quotas, persist desired_status=allocated. Default placement is shared (no AKS pool). Idempotent per live site.
Claim a hosted Machine for a site (DB desired-state; reconcile allocates).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-apphost |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
site_uuid | uuid | Yes | — | Hosted site (the AppHost project) this Machine belongs to |
sku | string | No | small | small |
mode | string | No | sleepable | sleepable (default) |
placement | string | No | shared | shared (default, packed pool) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
machine_uuid | uuid | Yes | — | — |
site_uuid | uuid | Yes | — | — |
organization_uuid | uuid | No | — | — |
sku | string | Yes | — | — |
mode | string | Yes | — | — |
status | string | Yes | — | — |
desired_status | string | Yes | — | — |
aks_pool_name | string | No | — | — |
placement | string | Yes | — | — |
created | boolean | Yes | — | — |
already_exists | boolean | Yes | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Claim accepted; will validate quotas and persist the Machine |
completed | No | Yes | Yes | — | Machine claimed (or existing live Machine returned) |
failed | No | Yes | No | — | Claim rejected |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
claimed | SUCCESS | Hosted Machine claimed (or existing live Machine returned) | machine_uuid, sku, mode, status |
failed | FAILURE | Apphost workflow failed | failure_reason |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "apphost.machine.claim",
"initial_data": {
"site_uuid": "value"
}
}