Skip to content

Commit 387eea7

Browse files
authored
Enable API reference workflow schedule and add volumes endpoints (#192)
Uncomment the cron schedule in the api-reference-validation workflow so it runs every Thursday at 8 PM UTC. Remove the exclusion of /volumes paths from the generation script, add Volumes to the tag ordering, and regenerate openapi-public.yml with the new volumes endpoints included.
1 parent a35be52 commit 387eea7

File tree

3 files changed

+174
-7
lines changed

3 files changed

+174
-7
lines changed

.github/workflows/api-reference-validation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: API Reference Validation
22

33
on:
4-
# schedule:
5-
# # Every Thursday at 8 PM UTC
6-
# - cron: '0 20 * * 4'
4+
schedule:
5+
# Every Thursday at 8 PM UTC
6+
- cron: '0 20 * * 4'
77
workflow_dispatch:
88

99
concurrency:

openapi-public.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,98 @@ paths:
12121212
summary: List template tags
12131213
servers:
12141214
- *id001
1215+
/volumes:
1216+
get:
1217+
description: List all team volumes
1218+
tags:
1219+
- Volumes
1220+
security:
1221+
- ApiKeyAuth: []
1222+
responses:
1223+
'200':
1224+
description: Successfully listed all team volumes
1225+
content:
1226+
application/json:
1227+
schema:
1228+
type: array
1229+
items:
1230+
$ref: '#/components/schemas/Volume'
1231+
'401':
1232+
$ref: '#/components/responses/401'
1233+
'500':
1234+
$ref: '#/components/responses/500'
1235+
operationId: listVolumes
1236+
post:
1237+
description: Create a new team volume
1238+
tags:
1239+
- Volumes
1240+
security:
1241+
- ApiKeyAuth: []
1242+
requestBody:
1243+
required: true
1244+
content:
1245+
application/json:
1246+
schema:
1247+
$ref: '#/components/schemas/NewVolume'
1248+
responses:
1249+
'201':
1250+
description: Successfully created a new team volume
1251+
content:
1252+
application/json:
1253+
schema:
1254+
$ref: '#/components/schemas/VolumeAndToken'
1255+
'400':
1256+
$ref: '#/components/responses/400'
1257+
'401':
1258+
$ref: '#/components/responses/401'
1259+
'500':
1260+
$ref: '#/components/responses/500'
1261+
operationId: postVolumes
1262+
servers:
1263+
- *id001
1264+
/volumes/{volumeID}:
1265+
get:
1266+
description: Get team volume info
1267+
tags:
1268+
- Volumes
1269+
security:
1270+
- ApiKeyAuth: []
1271+
parameters:
1272+
- $ref: '#/components/parameters/volumeID'
1273+
responses:
1274+
'200':
1275+
description: Successfully retrieved a team volume
1276+
content:
1277+
application/json:
1278+
schema:
1279+
$ref: '#/components/schemas/VolumeAndToken'
1280+
'401':
1281+
$ref: '#/components/responses/401'
1282+
'404':
1283+
$ref: '#/components/responses/404'
1284+
'500':
1285+
$ref: '#/components/responses/500'
1286+
operationId: getVolume
1287+
delete:
1288+
description: Delete a team volume
1289+
tags:
1290+
- Volumes
1291+
security:
1292+
- ApiKeyAuth: []
1293+
parameters:
1294+
- $ref: '#/components/parameters/volumeID'
1295+
responses:
1296+
'204':
1297+
description: Successfully deleted a team volume
1298+
'401':
1299+
$ref: '#/components/responses/401'
1300+
'404':
1301+
$ref: '#/components/responses/404'
1302+
'500':
1303+
$ref: '#/components/responses/500'
1304+
operationId: deleteVolume
1305+
servers:
1306+
- *id001
12151307
/health:
12161308
get:
12171309
summary: Check the health of the service
@@ -2473,6 +2565,9 @@ components:
24732565
type: integer
24742566
description: Used virtual memory in bytes
24752567
format: int64
2568+
mem_cache:
2569+
type: integer
2570+
description: Cached memory (page cache) in bytes
24762571
mem_total_mib:
24772572
type: integer
24782573
description: Total virtual memory in MiB
@@ -3333,6 +3428,24 @@ components:
33333428
properties:
33343429
enabled:
33353430
$ref: '#/components/schemas/SandboxAutoResumeEnabled'
3431+
SandboxOnTimeout:
3432+
type: string
3433+
description: Action taken when the sandbox times out.
3434+
enum:
3435+
- kill
3436+
- pause
3437+
SandboxLifecycle:
3438+
type: object
3439+
description: Sandbox lifecycle policy returned by sandbox info.
3440+
required:
3441+
- autoResume
3442+
- onTimeout
3443+
properties:
3444+
autoResume:
3445+
type: boolean
3446+
description: Whether the sandbox can auto-resume.
3447+
onTimeout:
3448+
$ref: '#/components/schemas/SandboxOnTimeout'
33363449
SandboxLog:
33373450
description: Log entry with timestamp and line
33383451
required:
@@ -3404,6 +3517,7 @@ components:
34043517
- cpuUsedPct
34053518
- memUsed
34063519
- memTotal
3520+
- memCache
34073521
- diskUsed
34083522
- diskTotal
34093523
properties:
@@ -3432,6 +3546,10 @@ components:
34323546
type: integer
34333547
format: int64
34343548
description: Total memory in bytes
3549+
memCache:
3550+
type: integer
3551+
format: int64
3552+
description: Cached memory (page cache) in bytes
34353553
diskUsed:
34363554
type: integer
34373555
format: int64
@@ -3537,6 +3655,12 @@ components:
35373655
description: 'Access token for authenticating envd requests to this sandbox.
35383656
Only returned when the sandbox is created with `secure: true`. Null for
35393657
non-secure sandboxes (envd endpoints work without auth).'
3658+
allowInternetAccess:
3659+
type:
3660+
- boolean
3661+
- 'null'
3662+
description: Whether internet access was explicitly enabled or disabled
3663+
for the sandbox. Null means it was not explicitly set.
35403664
domain:
35413665
type:
35423666
- string
@@ -3553,6 +3677,10 @@ components:
35533677
$ref: '#/components/schemas/SandboxMetadata'
35543678
state:
35553679
$ref: '#/components/schemas/SandboxState'
3680+
network:
3681+
$ref: '#/components/schemas/SandboxNetworkConfig'
3682+
lifecycle:
3683+
$ref: '#/components/schemas/SandboxLifecycle'
35563684
volumeMounts:
35573685
type: array
35583686
items:
@@ -4373,10 +4501,48 @@ components:
43734501
items:
43744502
type: string
43754503
type: object
4504+
Volume:
4505+
type: object
4506+
properties:
4507+
volumeID:
4508+
type: string
4509+
description: ID of the volume
4510+
name:
4511+
type: string
4512+
description: Name of the volume
4513+
required:
4514+
- volumeID
4515+
- name
4516+
VolumeAndToken:
4517+
type: object
4518+
properties:
4519+
volumeID:
4520+
type: string
4521+
description: ID of the volume
4522+
name:
4523+
type: string
4524+
description: Name of the volume
4525+
token:
4526+
type: string
4527+
description: Auth token to use for interacting with volume content
4528+
required:
4529+
- volumeID
4530+
- name
4531+
- token
4532+
NewVolume:
4533+
type: object
4534+
properties:
4535+
name:
4536+
type: string
4537+
description: Name of the volume
4538+
pattern: ^[a-zA-Z0-9_-]+$
4539+
required:
4540+
- name
43764541
tags:
43774542
- name: Sandboxes
43784543
- name: Templates
43794544
- name: Tags
4545+
- name: Volumes
43804546
- name: Envd
43814547
- name: Filesystem
43824548
- name: Process

scripts/generate_openapi_reference.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,13 @@ def _has_admin_token_security(path_item: dict[str, Any]) -> bool:
11441144
def filter_paths(spec: dict[str, Any]) -> None:
11451145
"""Clean up paths that should not appear in the public spec.
11461146
1147-
- Removes access-token and api-key endpoints
1147+
- Removes access-token, api-key endpoints
11481148
- Removes endpoints using AdminToken auth
11491149
- Strips Supabase auth entries from all operations
11501150
- Removes Supabase and AdminToken securityScheme definitions
11511151
"""
11521152
# Remove excluded paths
1153-
excluded_prefixes = ("/access-tokens", "/api-keys", "/volumes")
1153+
excluded_prefixes = ("/access-tokens", "/api-keys")
11541154
excluded_exact = {"/init"}
11551155
to_remove = [
11561156
p for p in spec["paths"]
@@ -1165,7 +1165,7 @@ def filter_paths(spec: dict[str, Any]) -> None:
11651165
for path in to_remove:
11661166
del spec["paths"][path]
11671167
if to_remove:
1168-
print(f"==> Removed {len(to_remove)} paths (volumes, admin, internal)")
1168+
print(f"==> Removed {len(to_remove)} paths (admin, internal)")
11691169

11701170
# Strip supabase security entries from all operations
11711171
for path_item in spec["paths"].values():
@@ -1329,8 +1329,9 @@ def rename_and_reorder_tags(spec: dict[str, Any]) -> None:
13291329
"auth": "Teams",
13301330
"health": "Envd",
13311331
"files": "Filesystem",
1332+
"volumes": "Volumes",
13321333
}
1333-
TAG_ORDER = ["Sandboxes", "Templates", "Tags", "Envd", "Filesystem", "Process", "Teams"]
1334+
TAG_ORDER = ["Sandboxes", "Templates", "Tags", "Volumes", "Envd", "Filesystem", "Process", "Teams"]
13341335

13351336
# Rename tags on all operations; tag untagged ones as "Others"
13361337
for path_item in spec.get("paths", {}).values():

0 commit comments

Comments
 (0)