Harthelm Docs
REST APIBackups

Restore an archive into a new workspace

Needs `team.create_workspace` on the archive's team. Creates a new workspace in that team with the archive's `/data/app` and tool store (`/data/tools`); env vars, secrets and the landscape are not part of an archive (Sync again). The new workspace starts asleep with sleep reason `restore` and wakes when its volume is filled; follow the Operation (kind `workspace.restore_archive`). Plan, base image, availability and restriction default to the archived workspace's; the origin repository goes on the new workspace's git access list as at creation. 409 `name-taken` like a create; 409 `backups-disabled`; 404 for a pruned archive.

Generated from openapi/harthelm.yaml at v1.5.0
POST
/archives/{archive}/restore

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

archive*integer

Numeric resource id.

Formatint64
Range1 <= value

Header Parameters

Idempotency-Key?string

Client-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.

Length1 <= length <= 255

Request Body

application/json
  1. body
name*string

The new workspace's name.

Match^[A-Za-z0-9]([-A-Za-z0-9 _.]{0,62}[A-Za-z0-9])?$
plan?string

Defaults to the archive's plan.

availability?Availability
Value in"always""on-demand"
restricted?boolean

Response Body

Accepted; the new workspace exists, asleep, with the restore's Operation.

application/json
  1. response
workspace*
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/archives/1/restore' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
{  "workspace": {    "id": 1,    "team_id": 1,    "name": "string",    "plan": "string",    "base_image": "string",    "git": {      "provider": "string",      "repo": "string",      "ref": "string"    },    "storage_gib": 1,    "availability": "always",    "restricted": true,    "state": "creating",    "status_detail": "string",    "urls": {      "ide": "string",      "dev": "string"    },    "dev_service": {      "name": "string",      "state": "running",      "wake_seconds": 0,      "needs": [        "string"      ],      "failing_needs": [        "string"      ]    },    "vault_id": 1,    "single_node": true,    "idle_timeout_minutes": 1,    "last_archived_at": "2019-08-24T14:15:22Z",    "restored_from": 1,    "upgrade_pending": true,    "created_by": 1,    "owner_id": 1,    "needs_owner": true,    "permissions": [      "string"    ],    "created_at": "2019-08-24T14:15:22Z",    "deleted_at": "2019-08-24T14:15:22Z",    "purge_after": "2019-08-24T14:15:22Z"  },  "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"  }}