import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/org/workspaces/{workspace_id} \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idle_ttl_hours": 123,
"image": "<string>",
"image_source": "repository_profile",
"isolation": "vm",
"isolation_note": "<string>",
"kind": "<string>",
"last_error": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"namespace": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pod_name": "<string>",
"progress_message": "<string>",
"purpose": "member",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_class_name": "<string>",
"sandbox_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec_hash": "<string>",
"status": "provisioning",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Tear a workspace down
Bearer PAT authentication; RBAC permission workspaces.use for the caller’s own workspace, workspaces.manage for another member’s. Tears the workspace down (its namespace, pod and volume go with it) and answers it destroyed; a destroyed workspace answers as it is. A teardown the cluster refused leaves it tearing_down with the reason, and is retried by the next call.
import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://platform.ankra.app/api/v1/org/workspaces/{workspace_id} \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idle_ttl_hours": 123,
"image": "<string>",
"image_source": "repository_profile",
"isolation": "vm",
"isolation_note": "<string>",
"kind": "<string>",
"last_error": "<string>",
"last_used_at": "2023-11-07T05:31:56Z",
"namespace": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pod_name": "<string>",
"progress_message": "<string>",
"purpose": "member",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_class_name": "<string>",
"sandbox_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec_hash": "<string>",
"status": "provisioning",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Response
Successful response
An Ankra Workspace: a member's pod on the organisation's CI pool that commands for one repository run in.
What the workspace pod runs behind: vm (a Kata Containers RuntimeClass, a virtual machine per pod), gvisor (a gVisor RuntimeClass, a user-space kernel) or container (the node's default runtime, sharing the host kernel). Null for a workspace created before this was recorded, which is unknown rather than container.
vm, gvisor, container, null Why the isolation is container (the cluster offers no sandbox RuntimeClass, or its RuntimeClasses could not be read when the workspace was created), or that a sandbox was chosen from less than the cluster's whole answer (a listing cut short, a RuntimeClass that could not be used). Null when the choice was made from a complete, clean read.
What a provisioning workspace is waiting on, as this read found its pod: the scheduler's reason it has no node yet, a container restarting, the readiness check's last answer. Null when there is nothing to report, on every status but provisioning, and in listings.