apphost.site.set-mode ​
Switch a hosted site between active, redirect, and suspended serving modes
Switch how a hosted site is served (active | redirect | suspended).
Inputs:
- site_uuid: the HostedSite (required)
- mode: active | redirect | suspended (required)
- redirect_target: absolute https URL, required iff mode=redirect
Behavior: updates hosted_site.mode (+redirect_target) and mirrors the mapping into the CloudFront KVS. mode=active is rejected when the site has no active release. Outputs: site_uuid, mode, url.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-apphost |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
site_uuid | uuid | Yes | — | HostedSite UUID. |
mode | string | Yes | — | Target serving mode: active |
redirect_target | string | No | — | Absolute https URL; required iff mode=redirect. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
site_uuid | uuid | No | — | — |
mode | string | No | — | — |
url | string | No | — | Public serving URL for the site's slug. |
redirect_target | string | No | — | Absolute https URL when mode=redirect; otherwise omitted. |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
reason | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Mode change accepted; will validate and apply |
completed | No | Yes | Yes | — | hosted_site.mode updated and KVS mapping written |
failed | No | Yes | No | — | Mode change rejected or KVS write failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Validate the request, update the row, mirror into KVS |
* (any state) | fail | failed | Terminal failure |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
mode_updated | SUCCESS | Hosted site serving mode updated and mirrored to CloudFront KVS | site_uuid, mode, url |
failed | FAILURE | Apphost workflow failed | failure_reason |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "apphost.site.set-mode",
"initial_data": {
"site_uuid": "value",
"mode": "value"
}
}