Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 62 additions & 24 deletions components/renku_data_services/notebooks/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ paths:
minLength: 1
responses:
'200':
description: The Docker image is available.
'404':
description: The Docker image is not available.
content:
application/json:
schema:
"$ref": "#/components/schemas/ImageCheckResponse"
'422':
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
description: The image url is malformed.
tags:
- notebooks
"/notebooks/logs/{server_name}":
Expand Down Expand Up @@ -355,27 +362,28 @@ paths:
tags:
- sessions
"/sessions/images":
get:
summary: Check if a session image exists
parameters:
- description: The Docker image URL (tag included) that should be fetched.
in: query
name: image_url
required: true
schema:
type: string
minLength: 1
responses:
"200":
description: The docker image can be found
"404":
description: The docker image cannot be found or the user does not have permissions to access it
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
default:
$ref: "#/components/responses/Error"
get:
description: Check if a session image exists
parameters:
- description: The Docker image URL (tag included) that should be fetched.
in: query
name: image_url
required: true
schema:
type: string
minLength: 1
responses:
'200':
content:
application/json:
schema:
"$ref": "#/components/schemas/ImageCheckResponse"
'422':
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
description: The image url is malformed.
tags:
- sessions
components:
Expand Down Expand Up @@ -1036,7 +1044,37 @@ components:
maxLength: 50
pattern: '^[a-z]([-a-z0-9]*[a-z0-9])?$'
example: d185e68d-d43-renku-2-b9ac279a4e8a85ac28d08
ImageCheckResponse:
type: object
properties:
accessible:
type: boolean
description: Whether the image is accessible or not.
connection:
allOf:
- "$ref": "#/components/schemas/ImageConnectionStatus"
- description: Whether an oauth2 connection is or can be used to access the image. If null indicates that there is no oauth2 connection we can use to access the requested image.
required:
- accessible
ImageConnection:
type: object
properties:
id:
type: string
status:
"$ref": "#/components/schemas/ImageConnectionStatus"
required:
- id
- status
ImageConnectionStatus:
type: string
enum:
- connected
- pending
- disconnected
responses:
ImageCheckResponse:
description: Information about whether a docker image is available or not and if there is a connected service then which connected service can be used to access the image.
Error:
description: The schema for all 4xx and 5xx responses
content:
Expand Down
18 changes: 17 additions & 1 deletion components/renku_data_services/notebooks/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2025-04-17T14:26:28+00:00
# timestamp: 2025-08-26T12:05:22+00:00

from __future__ import annotations

Expand Down Expand Up @@ -281,6 +281,12 @@ class SessionCloudStoragePost(BaseAPISpec):
)


class ImageConnectionStatus(Enum):
connected = "connected"
pending = "pending"
disconnected = "disconnected"


class NotebooksImagesGetParametersQuery(BaseAPISpec):
image_url: str = Field(..., min_length=1)

Expand Down Expand Up @@ -356,6 +362,16 @@ class SessionResources(BaseAPISpec):
requests: Optional[SessionResourcesRequests] = None


class ImageCheckResponse(BaseAPISpec):
accessible: bool = Field(..., description="Whether the image is accessible or not.")
connection: Optional[ImageConnectionStatus] = None


class ImageConnection(BaseAPISpec):
id: str
status: ImageConnectionStatus


class NotebookResponse(BaseAPISpec):
annotations: Optional[FieldUserPodAnnotations] = None
cloudstorage: Optional[List[LaunchNotebookResponseCloudStorage]] = None
Expand Down
Loading