Forráskód Böngészése

release: 0.5.0 - requires smartbotic-database client 2.12.0

Depends and the build pin both move to >= 2.12.0, because this release
calls entry points that do not exist in 2.11.4: removeAs(),
subscribeEvents(), patchIfVersion() and errorDetail(). The database must
therefore be upgraded first.

Documents the two per-project function-limit routes, which a route sweep
over every svr.Get/Post/Put/Patch/Delete registration found missing. The
only paths still undocumented are the pre-existing meta endpoints
(/docs, /llms.txt, /openapi.json) and the SPA's own /ui/* session routes.
fszontagh 1 hónapja
szülő
commit
eee8c812a5
3 módosított fájl, 45 hozzáadás és 2 törlés
  1. 1 1
      VERSION
  2. 7 0
      api/llms.txt
  3. 37 1
      api/openapi.json

+ 1 - 1
VERSION

@@ -1 +1 @@
-0.4.0
+0.5.0

+ 7 - 0
api/llms.txt

@@ -164,6 +164,13 @@ A `NAME` must match `[A-Z_][A-Z0-9_]*` and be at most 64 characters - the charse
 
 Deleting a project deletes its secrets, so a recycled project name inherits nothing.
 
+### Per-project function limits
+
+- `GET  /api/v1/projects/{project}/settings/functions` **(admin)** - `{max_wall_time_ms}`; null means the project inherits the runner's ceiling.
+- `PUT  /api/v1/projects/{project}/settings/functions` `{max_wall_time_ms: int|null}` **(admin)** - the ceiling a function here may ask for with its own `timeoutMs`. It can only NARROW: the effective budget is `min(descriptor timeoutMs or default, project max or kind ceiling, hard ceiling)`. Admin-only because it decides how long one project may hold a pooled runtime, and so how long it can delay every other project's interactive routes.
+
+**A job run and an HTTP run have different ceilings.** An HTTP route answers a caller holding a socket open (seconds); a queue-claimed run has nobody waiting (minutes, 120 s by default) and draws from its own pool lane, so a slow scheduled job cannot take the runtime an interactive route needs.
+
 ## Functions
 
 Server-side JavaScript that serves HTTP routes. These routes require a key granted the project (admin keys reach every project); capability-scoped publishable keys are refused. **Changing a function's policy is admin-only** - developers push code, admins grant what it may touch, exactly as keys already work.

+ 37 - 1
api/openapi.json

@@ -2,7 +2,7 @@
   "openapi": "3.1.0",
   "info": {
     "title": "smartbotic-vectorapi",
-    "version": "0.4.0",
+    "version": "0.5.0",
     "description": "General-purpose REST API fronting smartbotic-database. Supports multi-project namespacing and multi-key authorization with per-project grants."
   },
   "components": {
@@ -1664,6 +1664,42 @@
         }
       }
     },
+    "/api/v1/projects/{project}/settings/functions": {
+      "get": {
+        "tags": ["Settings"],
+        "summary": "Per-project function limits",
+        "description": "Admin only. `max_wall_time_ms` is the ceiling a function in this project may ask for with its own `timeoutMs`; null means the project inherits the runner's ceiling for the kind of run. A project maximum can only NARROW, never raise: the effective budget is min(descriptor timeoutMs or default, project max or kind ceiling, hard ceiling).",
+        "parameters": [
+          { "name": "project", "in": "path", "required": true, "schema": { "type": "string" } }
+        ],
+        "responses": {
+          "200": { "description": "The project's limits.",
+                   "content": { "application/json": { "schema": {
+                     "type": "object",
+                     "properties": { "max_wall_time_ms": { "type": ["integer", "null"] } } } } } },
+          "403": { "description": "Not an admin key.",
+                   "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
+        }
+      },
+      "put": {
+        "tags": ["Settings"],
+        "summary": "Set the per-project function wall-time cap",
+        "description": "Admin only, because it decides how long one project may hold a pooled runtime - and therefore how long it can delay every other project's interactive routes. Send null to inherit.",
+        "parameters": [
+          { "name": "project", "in": "path", "required": true, "schema": { "type": "string" } }
+        ],
+        "requestBody": { "required": true, "content": { "application/json": { "schema": {
+          "type": "object",
+          "properties": { "max_wall_time_ms": { "type": ["integer", "null"], "minimum": 1 } } } } } },
+        "responses": {
+          "200": { "description": "Stored." },
+          "403": { "description": "Not an admin key.",
+                   "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
+          "422": { "description": "Not an integer or null.",
+                   "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
+        }
+      }
+    },
     "/api/v1/projects/{project}/settings/embeddings": {
       "parameters": [
         {