Harthelm Docs
REST APILandscape

Tear the landscape down

One transaction stops every service, sets their desired replicas to 0 and the landscape state to `torn-down`; the reconcile removes the services' Deployments, Services and Secrets and their routes. The code in `/data/app` and the vault stay; a Sync rebuilds everything. Needs `landscape.manage`.

Generated from openapi/harthelm.yaml at v1.5.0
POST
/workspaces/{ws}/landscape/teardown

Authorization

cookie__Host-harthelm_session<token>

Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header Harthelm-CSRF: 1 and a matching Origin.

Path Parameters

ws*integer

Numeric resource id.

Formatint64
Range1 <= value

Response Body

Torn down; the Operation landscape.teardown succeeds when the objects are gone.

application/json
  1. response
landscape*
operation*

A long-running action. It ends in succeeded or failed and stays readable for 7 days.

curl -X POST 'https://console.example.com/api/v1/workspaces/1/landscape/teardown'
{  "landscape": {    "workspace_id": 1,    "state": "empty",    "profile": "string",    "selected_profile": "string",    "spec_hash": "string",    "source_hash": "string",    "source_commit": "string",    "generation": 0,    "synced_at": "2019-08-24T14:15:22Z",    "synced_by": 1,    "run_state": "stopped",    "run_generation": 0,    "operation_id": "cb4ede3c-a5d1-45e3-a9d2-fe83accbce52",    "services": [      {        "name": "string",        "type": "steps",        "plan": "string",        "replicas": 1,        "desired_replicas": 0,        "ready_replicas": 0,        "availability": "always",        "run_state": "stopped",        "status": "pending",        "status_detail": "string",        "ports": [          {            "port": 1,            "public": true,            "url": "string",            "routes": [              {                "path": "string",                "strip": true              }            ]          }        ],        "health": {          "port": 0,          "path": "string",          "mode": "any-http"        },        "max_replicas": 1,        "image": "string",        "image_ref": "string",        "run_as_user": 0,        "autonomous": true,        "target": "string",        "routes": [          {            "path": "string",            "strip": true          }        ],        "run_result": {          "result": "success",          "generation": 0,          "message": "string",          "at": "2019-08-24T14:15:22Z"        },        "upgrade_pending": true,        "managed_service_id": "77427583-c503-4b42-8d68-8e0a3b2c8384",        "managed_status": "creating",        "needs": [          "string"        ],        "failing": true      }    ]  },  "operation": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "kind": "string",    "state": "pending",    "target": "string",    "detail": "string",    "error": {      "type": "about:blank",      "title": "string",      "status": 100,      "detail": "string",      "instance": "string",      "errors": [        {          "pointer": "string",          "line": 1,          "column": 1,          "message": "string",          "code": "string",          "subject": "string"        }      ],      "held_by_deleted": {        "workspaces": 0,        "storage_gib": 0      },      "failed_team": {        "id": 1,        "name": "string",        "reason": "string"      }    },    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "finished_at": "2019-08-24T14:15:22Z"  }}

Sync the landscape

Plans again and, if the result's `spec_hash` equals `If-Match`, writes the spec, the service rows and the new generation in one transaction and enqueues the reconcile (this transaction alone runs with `synchronous_commit = off`). Sync never starts steps; Run does. `If-Match` is the `spec_hash` of the plan the user reviewed: a different one (the file, the env vars or the catalog changed since) answers 409 with problem `plan-changed`; a missing one 428. Other 409 problems: `secrets-missing` (a referenced vault key has no value), `landscape-blocked` (the plan has blockers; `errors` lists them), `quota-exceeded`. Needs `landscape.manage`.

Write harthelm.yml

Writes the profile's file through the IDE agent, the one file write the console has. `If-Match` is the quoted SHA-256 the editor read; `If-None-Match: *` creates a file that must not exist yet; neither is 428. A file whose hash is not `If-Match` (or that exists under `If-None-Match: *`) is 412 with problem `config-changed`: the editor re-reads and offers *Save and override*, which sends the new hash. The agent writes atomically (a temporary file in `/data/app` renamed over the old one, mode kept) and does not validate: a file with a syntax error is saved as written, and the next Plan answers 422 `invalid-config`. The content is UTF-8 without NUL bytes (422 with pointer `/content`), at most 1 MiB (413). Nothing else changes: the synced landscape keeps running until a Sync. Needs `workspace.code`; audited as `landscape.config_write` (profile and the new hash).