Skip to content
Open
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
20 changes: 11 additions & 9 deletions spec/openapi.dashboard-api.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions spec/openapi.infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,39 @@ components:
resume); auto-resume, which can be triggered by arbitrary traffic,
refuses such a sandbox. Defaults to true.

SandboxForkRequest:
type: object
properties:
timeout:
type: integer
format: int32
minimum: 0
default: 15
description: Time to live for the new forked sandboxes in seconds.
count:
type: integer
format: int32
minimum: 1
maximum: 100
default: 1
description: >-
Number of forked sandboxes to create. All forks boot from the same
snapshot, so the snapshot is captured once regardless of count.
Each fork succeeds or fails independently; the outcome of each is
reported in its entry of the response list.

SandboxForkResult:
type: object
description: >-
Result of one requested fork. Exactly one of sandbox or error is set:
sandbox when the fork started successfully, error when it failed to
start.
properties:
sandbox:
$ref: "#/components/schemas/Sandbox"
error:
$ref: "#/components/schemas/Error"

TeamMetric:
description: Team metric with timestamp
required:
Expand Down Expand Up @@ -1549,6 +1582,10 @@ components:
- cpuCount
- memoryTotalBytes
- disks
- hugePagesTotal
- hugePagesUsed
- hugePagesReserved
- hugePageSizeBytes
properties:
allocatedCPU:
type: integer
Expand All @@ -1574,6 +1611,22 @@ components:
type: integer
format: uint64
description: Total node memory in bytes
hugePagesTotal:
type: integer
format: uint64
description: Total number of preallocated hugepages on the node
hugePagesUsed:
type: integer
format: uint64
description: Number of hugepages in use (total - free)
hugePagesReserved:
type: integer
format: uint64
description: Number of reserved hugepages (committed but not yet faulted)
hugePageSizeBytes:
type: integer
format: uint64
description: Size of a single hugepage in bytes
disks:
type: array
description: Detailed metrics for each disk/mount point
Expand Down Expand Up @@ -2512,6 +2565,52 @@ paths:
"500":
$ref: "#/components/responses/500"

/sandboxes/{sandboxID}/fork:
post:
summary: Fork sandbox
description: >-
Fork the sandbox: checkpoint the running sandbox in place (it is
briefly paused, snapshotted with its full memory state, and resumed on
its node, keeping its ID and expiration untouched) and create count
new sandboxes from that snapshot. Returns one result per requested
fork, each carrying either the created sandbox or the error that
prevented it from starting. A non-201 status means the request failed
before any fork was attempted.
tags: [sandboxes]
security:
- ApiKeyAuth: []
- AuthProviderBearerAuth: []
AuthProviderTeamAuth: []
- AdminApiKeyAuth: []
AdminTeamAuth: []
parameters:
- $ref: "#/components/parameters/sandboxID"
requestBody:
required: false
content:
application/json:
schema:
$ref: "#/components/schemas/SandboxForkRequest"
responses:
"201":
description: >-
The sandbox was snapshotted and the forks were attempted; each
entry reports one fork's outcome
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/SandboxForkResult"
"409":
$ref: "#/components/responses/409"
"404":
$ref: "#/components/responses/404"
"401":
$ref: "#/components/responses/401"
"500":
$ref: "#/components/responses/500"

/sandboxes/{sandboxID}/connect:
post:
summary: Connect sandbox
Expand Down Expand Up @@ -2691,6 +2790,12 @@ paths:
schema:
type: string
description: Filter snapshots by source sandbox ID
- name: name
in: query
description: Filter snapshots by name or ID, optionally tag-qualified (e.g. "my-snapshot", "my-team/my-snapshot" or "my-snapshot:v1").
required: false
schema:
type: string
- $ref: "#/components/parameters/paginationLimit"
- $ref: "#/components/parameters/paginationNextToken"
responses:
Expand Down
6 changes: 5 additions & 1 deletion src/core/shared/contracts/dashboard-api.types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions src/core/shared/contracts/infra-api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,55 @@ export interface paths {
patch?: never
trace?: never
}
'/sandboxes/{sandboxID}/fork': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
get?: never
put?: never
/**
* Fork sandbox
* @description Fork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its ID and expiration untouched) and create count new sandboxes from that snapshot. Returns one result per requested fork, each carrying either the created sandbox or the error that prevented it from starting. A non-201 status means the request failed before any fork was attempted.
*/
post: {
parameters: {
query?: never
header?: never
path: {
sandboxID: components['parameters']['sandboxID']
}
cookie?: never
}
requestBody?: {
content: {
'application/json': components['schemas']['SandboxForkRequest']
}
}
responses: {
/** @description The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome */
201: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['SandboxForkResult'][]
}
}
401: components['responses']['401']
404: components['responses']['404']
409: components['responses']['409']
500: components['responses']['500']
}
}
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/sandboxes/{sandboxID}/connect': {
parameters: {
query?: never
Expand Down Expand Up @@ -936,6 +985,8 @@ export interface paths {
parameters: {
query?: {
sandboxID?: string
/** @description Filter snapshots by name or ID, optionally tag-qualified (e.g. "my-snapshot", "my-team/my-snapshot" or "my-snapshot:v1"). */
name?: string
/** @description Maximum number of items to return per page */
limit?: components['parameters']['paginationLimit']
/** @description Cursor to start the list from */
Expand Down Expand Up @@ -2842,6 +2893,25 @@ export interface components {
*/
memory: boolean
}
SandboxForkRequest: {
/**
* Format: int32
* @description Time to live for the new forked sandboxes in seconds.
* @default 15
*/
timeout: number
/**
* Format: int32
* @description Number of forked sandboxes to create. All forks boot from the same snapshot, so the snapshot is captured once regardless of count. Each fork succeeds or fails independently; the outcome of each is reported in its entry of the response list.
* @default 1
*/
count: number
}
/** @description Result of one requested fork. Exactly one of sandbox or error is set: sandbox when the fork started successfully, error when it failed to start. */
SandboxForkResult: {
sandbox?: components['schemas']['Sandbox']
error?: components['schemas']['Error']
}
/** @description Team metric with timestamp */
TeamMetric: {
/**
Expand Down Expand Up @@ -3325,6 +3395,26 @@ export interface components {
* @description Total node memory in bytes
*/
memoryTotalBytes: number
/**
* Format: uint64
* @description Total number of preallocated hugepages on the node
*/
hugePagesTotal: number
/**
* Format: uint64
* @description Number of hugepages in use (total - free)
*/
hugePagesUsed: number
/**
* Format: uint64
* @description Number of reserved hugepages (committed but not yet faulted)
*/
hugePagesReserved: number
/**
* Format: uint64
* @description Size of a single hugepage in bytes
*/
hugePageSizeBytes: number
/** @description Detailed metrics for each disk/mount point */
disks: components['schemas']['DiskMetrics'][]
}
Expand Down
Loading