import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', 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 GET \
--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",
"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>",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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"
}Get a workspace
Bearer PAT authentication; RBAC permission workspaces.use for the caller’s own workspace, workspaces.manage for another member’s. Reads one workspace. A provisioning workspace is checked first (devbox-preflight in its pod) and answered ready, failed with the reason, or still provisioning. The owner’s read counts as a use and pushes expires_at out by the idle TTL.
import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', 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 GET \
--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",
"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>",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
The workspace.
Response
Successful response
An Ankra Workspace: a member's pod on the organisation's CI pool that commands for one repository run in.
The cluster the workspace was placed on, once, at its first bring-up.
When the platform removes the workspace if nothing uses it first.
How long the workspace lives unused.
The toolchain image its main container runs.
Where the image came from.
repository_profile, pipeline_stage, pipeline_defaults, null The workspace profile it was built from.
Why the workspace failed, or why the platform removed it.
The Kubernetes namespace it runs in.
The pod commands run in.
The sandbox environment that owns its namespace.
SHA-256 of the objects it was rendered from.
provisioning, ready, failed, tearing_down, destroyed The member the workspace belongs to.