|
117 | 117 | "title": "VMAssignTagAliasResponse", |
118 | 118 | "type": "object" |
119 | 119 | }, |
| 120 | + "TemplateCreateRequest": { |
| 121 | + "properties": { |
| 122 | + "description": { |
| 123 | + "default": "[Template description]", |
| 124 | + "description": "Template description. Maximum 255 characters. Defaults to description of original sandbox.", |
| 125 | + "maxLength": 255, |
| 126 | + "type": "string" |
| 127 | + }, |
| 128 | + "forkOf": { |
| 129 | + "description": "Short ID of the sandbox to fork.", |
| 130 | + "example": "pt_1234567890", |
| 131 | + "type": "string" |
| 132 | + }, |
| 133 | + "tags": { |
| 134 | + "default": [], |
| 135 | + "description": "Tags to set on the new sandbox, if any. Will not inherit tags from the source sandbox.", |
| 136 | + "items": { "type": "string" }, |
| 137 | + "type": "array" |
| 138 | + }, |
| 139 | + "title": { |
| 140 | + "default": "[Template title]", |
| 141 | + "description": "Template title. Maximum 255 characters. Defaults to title of original sandbox with (forked).", |
| 142 | + "maxLength": 255, |
| 143 | + "type": "string" |
| 144 | + } |
| 145 | + }, |
| 146 | + "required": ["forkOf"], |
| 147 | + "title": "TemplateCreateRequest", |
| 148 | + "type": "object" |
| 149 | + }, |
120 | 150 | "PreviewToken": { |
121 | 151 | "properties": { |
122 | 152 | "expires_at": { "nullable": true, "type": "string" }, |
|
284 | 314 | "concurrent_vm_limit": { "type": "integer" }, |
285 | 315 | "vms": { |
286 | 316 | "items": { |
287 | | - "properties": { "id": { "type": "string" } }, |
| 317 | + "properties": { |
| 318 | + "credit_basis": { "type": "string" }, |
| 319 | + "id": { "type": "string" }, |
| 320 | + "last_active_at": { "type": "integer" }, |
| 321 | + "session_started_at": { "type": "integer" }, |
| 322 | + "specs": { |
| 323 | + "properties": { |
| 324 | + "cpu": { "type": "integer" }, |
| 325 | + "memory": { "type": "integer" }, |
| 326 | + "storage": { "type": "integer" } |
| 327 | + }, |
| 328 | + "type": "object" |
| 329 | + } |
| 330 | + }, |
288 | 331 | "type": "object" |
289 | 332 | }, |
290 | | - "required": ["id"], |
| 333 | + "required": [ |
| 334 | + "id", |
| 335 | + "last_active_at", |
| 336 | + "session_started_at", |
| 337 | + "specs", |
| 338 | + "credit_basis" |
| 339 | + ], |
291 | 340 | "type": "array" |
292 | 341 | } |
293 | 342 | }, |
|
492 | 541 | }, |
493 | 542 | "required": ["scopes", "team", "version"], |
494 | 543 | "type": "object" |
| 544 | + }, |
| 545 | + "rate_limits": { |
| 546 | + "description": "Current workspace rate limits", |
| 547 | + "properties": { |
| 548 | + "concurrent_vms": { |
| 549 | + "properties": { |
| 550 | + "limit": { "type": "integer" }, |
| 551 | + "remaining": { "type": "integer" } |
| 552 | + }, |
| 553 | + "type": "object" |
| 554 | + }, |
| 555 | + "requests_hourly": { |
| 556 | + "properties": { |
| 557 | + "limit": { "type": "integer" }, |
| 558 | + "remaining": { "type": "integer" }, |
| 559 | + "reset": { "type": "integer" } |
| 560 | + }, |
| 561 | + "type": "object" |
| 562 | + }, |
| 563 | + "sandboxes_hourly": { |
| 564 | + "properties": { |
| 565 | + "limit": { "type": "integer" }, |
| 566 | + "remaining": { "type": "integer" }, |
| 567 | + "reset": { "type": "integer" } |
| 568 | + }, |
| 569 | + "type": "object" |
| 570 | + } |
| 571 | + }, |
| 572 | + "required": [ |
| 573 | + "concurrent_vms", |
| 574 | + "sandboxes_hourly", |
| 575 | + "requests_hourly" |
| 576 | + ], |
| 577 | + "type": "object" |
495 | 578 | } |
496 | 579 | }, |
497 | 580 | "required": ["api"], |
|
1120 | 1203 | "title": "TokenCreateResponse", |
1121 | 1204 | "type": "object" |
1122 | 1205 | }, |
| 1206 | + "TemplateCreateResponse": { |
| 1207 | + "allOf": [ |
| 1208 | + { |
| 1209 | + "properties": { |
| 1210 | + "errors": { |
| 1211 | + "items": { |
| 1212 | + "oneOf": [ |
| 1213 | + { "type": "string" }, |
| 1214 | + { "additionalProperties": true, "type": "object" } |
| 1215 | + ], |
| 1216 | + "title": "Error" |
| 1217 | + }, |
| 1218 | + "type": "array" |
| 1219 | + }, |
| 1220 | + "success": { "type": "boolean" } |
| 1221 | + }, |
| 1222 | + "title": "Response", |
| 1223 | + "type": "object" |
| 1224 | + }, |
| 1225 | + { |
| 1226 | + "properties": { |
| 1227 | + "data": { |
| 1228 | + "properties": { |
| 1229 | + "sandboxes": { |
| 1230 | + "items": { |
| 1231 | + "properties": { |
| 1232 | + "cluster": { "type": "string" }, |
| 1233 | + "id": { "type": "string" } |
| 1234 | + }, |
| 1235 | + "required": ["id", "cluster"], |
| 1236 | + "type": "object" |
| 1237 | + }, |
| 1238 | + "type": "array" |
| 1239 | + }, |
| 1240 | + "tag": { "type": "string" } |
| 1241 | + }, |
| 1242 | + "required": ["tag", "sandboxes"], |
| 1243 | + "type": "object" |
| 1244 | + } |
| 1245 | + }, |
| 1246 | + "type": "object" |
| 1247 | + } |
| 1248 | + ], |
| 1249 | + "title": "TemplateCreateResponse", |
| 1250 | + "type": "object" |
| 1251 | + }, |
1123 | 1252 | "TokenCreateRequest": { |
1124 | 1253 | "properties": { |
1125 | 1254 | "default_version": { |
|
1932 | 2061 | "tags": [] |
1933 | 2062 | } |
1934 | 2063 | }, |
| 2064 | + "/templates": { |
| 2065 | + "post": { |
| 2066 | + "callbacks": {}, |
| 2067 | + "description": "Create a new template in the current workspace (creates 3 sandboxes and tags them)\n", |
| 2068 | + "operationId": "templates/create", |
| 2069 | + "parameters": [], |
| 2070 | + "requestBody": { |
| 2071 | + "content": { |
| 2072 | + "application/json": { |
| 2073 | + "schema": { "$ref": "#/components/schemas/TemplateCreateRequest" } |
| 2074 | + } |
| 2075 | + }, |
| 2076 | + "description": "Template Create Request", |
| 2077 | + "required": false |
| 2078 | + }, |
| 2079 | + "responses": { |
| 2080 | + "201": { |
| 2081 | + "content": { |
| 2082 | + "application/json": { |
| 2083 | + "schema": { |
| 2084 | + "$ref": "#/components/schemas/TemplateCreateResponse" |
| 2085 | + } |
| 2086 | + } |
| 2087 | + }, |
| 2088 | + "description": "Template Create Response" |
| 2089 | + } |
| 2090 | + }, |
| 2091 | + "security": [{ "authorization": ["template:create"] }], |
| 2092 | + "summary": "Create a template", |
| 2093 | + "tags": ["templates"] |
| 2094 | + } |
| 2095 | + }, |
1935 | 2096 | "/vm/alias/{namespace}/{alias}": { |
1936 | 2097 | "put": { |
1937 | 2098 | "callbacks": {}, |
|
0 commit comments