Skip to content

Notebooks 2.0 // Backend // Update list workspaces JSON payloads #127

@ederign

Description

@ederign

Update:

GET /api/v1/workspaces
GET /api/v1/workspaces/{namespace}
GET /api/v1/workspaces/{namespace}/{name}

For a payload similar to

{
    "data": [
        {
            "name": "jupyterlab-workspace",
            "namespace": "default",
            "workspace_kind": {
                "name": "jupyterlab",
                "type": "POD_TEMPLATE"
            },
            "defer_updates": false,
            "paused": false,
            "paused_time": 0,
            "state": "RUNNING",
            "state_message": "Pod is running",
            "pod_template": {
                "pod_metadata": {
                    "labels": {
                        "app": "jupyterlab",
                        "workspace": "jupyterlab-workspace"
                    },
                    "annotations": {
                        "workspace": "jupyterlab-workspace"
                    }
                },
                "volumes": {
                    "home": {
                        "pvc_name": "workspace-home-jupyterlab",
                        "mount_path": "/home/jovyan",
                        "read_only": false
                    },
                    "data": [
                        {
                            "pvc_name": "workspace-data-pvc",
                            "mount_path": "/data/my-data",
                            "read_only": false
                        }
                    ]
                },
                "image_config": {
                    "current": "jupyterlab_scipy_181",
                    "desired": "jupyterlab_scipy_190",
                    "redirect_chain": [
                        {
                            "source": "jupyterlab_scipy_181",
                            "target": "jupyterlab_scipy_190"
                        }
                    ]
                },
                "pod_config": {
                    "current": "tiny_cpu",
                    "desired": "tiny_cpu",
                    "redirect_chain": []
                }
            },
            "activity": {
                "last_activity": 1710435303,
                "last_update": 1710435310,
                "last_probe": {
                    "start_time_ms": 1710435303000,
                    "end_time_ms": 1710435305000,
                    "result": "SUCCESS",
                    "message": "Jupyter probe succeeded"
                }
            }
        }
    ]
}

We should group:

  • At least group all podTemplate specific stuff:
  • volumes
  • options (both the currently selected and redirect info)
    pod labels/annotations
  • Add a "workspace_kind" section which has an enum for the type (which only has POD_TEMPLATE right now)
  • Store all times as Unix Epoch
  • Separate out the Pod and Workspace labels/annotations (they are not the same)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions