interloper-api 0.67.0__tar.gz → 0.68.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {interloper_api-0.67.0 → interloper_api-0.68.0}/PKG-INFO +1 -1
- {interloper_api-0.67.0 → interloper_api-0.68.0}/pyproject.toml +1 -1
- {interloper_api-0.67.0 → interloper_api-0.68.0}/pyproject.toml.orig +1 -1
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/runs.py +16 -19
- {interloper_api-0.67.0 → interloper_api-0.68.0}/README.md +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/__init__.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/app.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/__init__.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/auth.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/rbac.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/state.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/__init__.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/invitations.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/__init__.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/admin.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/agent.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/auth.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/backfills.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/catalog.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/components.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/health.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/oauth.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/organisations.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/tokens.py +0 -0
- {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/websocket.py +0 -0
|
@@ -7,7 +7,6 @@ from typing import Annotated, Literal
|
|
|
7
7
|
from uuid import UUID
|
|
8
8
|
|
|
9
9
|
from fastapi import APIRouter, Depends, HTTPException, Query, Response
|
|
10
|
-
from interloper.component import KINDS
|
|
11
10
|
from interloper.errors import NotFoundError
|
|
12
11
|
from interloper_db import Profile, Store
|
|
13
12
|
from interloper_db.models import Event, Run
|
|
@@ -88,13 +87,13 @@ class RetryRequest(BaseModel):
|
|
|
88
87
|
scope: Literal["all", "failed"] = "all"
|
|
89
88
|
|
|
90
89
|
|
|
91
|
-
class
|
|
92
|
-
"""Response body for an
|
|
90
|
+
class ExecutionResponse(BaseModel):
|
|
91
|
+
"""Response body for an operation execution (from the ``executions`` view)."""
|
|
93
92
|
|
|
94
93
|
run_id: UUID
|
|
95
94
|
org_id: UUID
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
component_id: UUID | None = None
|
|
96
|
+
component_key: str
|
|
98
97
|
status: str
|
|
99
98
|
started_at: str | None = None
|
|
100
99
|
completed_at: str | None = None
|
|
@@ -238,7 +237,7 @@ def create_run(
|
|
|
238
237
|
user: Profile = Depends(get_current_user),
|
|
239
238
|
store: Store = Depends(get_store),
|
|
240
239
|
) -> RunResponse:
|
|
241
|
-
"""Queue a single run targeting a
|
|
240
|
+
"""Queue a single run targeting a component whose kind declares an operation.
|
|
242
241
|
|
|
243
242
|
Args:
|
|
244
243
|
body: The component to run and the partition key to run it for.
|
|
@@ -249,12 +248,10 @@ def create_run(
|
|
|
249
248
|
The queued run, as a response model.
|
|
250
249
|
|
|
251
250
|
Raises:
|
|
252
|
-
HTTPException: 400 if the
|
|
253
|
-
|
|
251
|
+
HTTPException: 400 if the store rejects the run (a kind with no
|
|
252
|
+
operation, or an invalid partition key).
|
|
254
253
|
"""
|
|
255
254
|
target = load_authorized(store.components.get, body.component_id, user, store, label="Component", minimum="editor")
|
|
256
|
-
if not KINDS[target.kind].runnable:
|
|
257
|
-
raise HTTPException(status_code=400, detail=f"Components of kind '{target.kind}' cannot be run")
|
|
258
255
|
try:
|
|
259
256
|
run = store.runs.create(target.org_id, component_id=body.component_id, partition_key=body.partition_key)
|
|
260
257
|
except ValueError as e:
|
|
@@ -282,13 +279,13 @@ def get_run(
|
|
|
282
279
|
return RunResponse.from_run(run)
|
|
283
280
|
|
|
284
281
|
|
|
285
|
-
@router.get("/{run_id}/
|
|
286
|
-
def
|
|
282
|
+
@router.get("/{run_id}/executions")
|
|
283
|
+
def list_executions(
|
|
287
284
|
run_id: UUID,
|
|
288
285
|
user: Profile = Depends(get_current_user),
|
|
289
286
|
store: Store = Depends(get_store),
|
|
290
|
-
) -> list[
|
|
291
|
-
"""List
|
|
287
|
+
) -> list[ExecutionResponse]:
|
|
288
|
+
"""List operation executions for a run.
|
|
292
289
|
|
|
293
290
|
Args:
|
|
294
291
|
run_id: The run UUID.
|
|
@@ -296,16 +293,16 @@ def list_asset_executions(
|
|
|
296
293
|
store: The Store instance.
|
|
297
294
|
|
|
298
295
|
Returns:
|
|
299
|
-
The run's
|
|
296
|
+
The run's operation executions, as response models.
|
|
300
297
|
"""
|
|
301
298
|
_load_authorized_run(run_id, user, store)
|
|
302
|
-
rows = store.events.
|
|
299
|
+
rows = store.events.list_executions(run_id)
|
|
303
300
|
return [
|
|
304
|
-
|
|
301
|
+
ExecutionResponse(
|
|
305
302
|
run_id=row.run_id,
|
|
306
303
|
org_id=row.org_id,
|
|
307
|
-
|
|
308
|
-
|
|
304
|
+
component_id=row.component_id,
|
|
305
|
+
component_key=row.component_key or "",
|
|
309
306
|
status=row.status,
|
|
310
307
|
started_at=str(row.started_at) if row.started_at else None,
|
|
311
308
|
completed_at=str(row.completed_at) if row.completed_at else None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/__init__.py
RENAMED
|
File without changes
|
{interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/invitations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|