Create Custom Op
POST/workspaces/:workspace_id/custom_ops
Accept an op for publishing; the build runs after the response.
The upload is either a bare handler.py or a zip of the whole op, told
apart by the archive's magic bytes rather than by filename or content type.
An archive must carry handler.py at its root; everything beside it is
built in with its nesting intact, since the archive root becomes /app
— the image's working directory and the first entry on sys.path.
The op names itself: the identity comes from the @aip.metric decorator
in that entrypoint, not from the request, so what the platform records
cannot disagree with what the op reports at runtime. Dependencies are
declared once, in the entrypoint's PEP 723 block, and cover the package.
Every rule the archive must satisfy — reserved root names, size and count
limits, refused entry shapes — is checked here and answered as a 400 that
creates no state. ops/README.md documents them for the op's author.
Returns the op's own name alongside building: the caller learns what
the file called itself, and that name is the key for
GET .../custom_ops/{name}, which reports the outcome.
Request
Responses
- 200
- 400
- 403
- 409
- 422
- 424
Successful Response
Bad Request
Forbidden
Conflict
Validation Error
Failed Dependency